haskell-platform

json parsing in haskell

荒凉一梦 提交于 2019-11-30 12:45:10
I'm trying to parse JSON data in haskell. Having gone through a slew of websites, this is the furthest I have been able to get to. data Address = Address { house :: Integer, street :: String, city :: String, state :: String, zip :: Integer } deriving (Show) data Person = Person { name :: String, age :: Integer, address :: Address } deriving (Show) getName :: Person -> String getName (Person n _ _) = n getAddress :: Person -> Address getAddress (Person _ _ a) = a getState :: Address -> String getState (Address _ _ _ s _) = s I write that in a file ex.hs and load it in ghci --> Prelude> import

Error installing stylish-haskell on Mac OS X on Haskell Platform 2013.2.0.0

时光毁灭记忆、已成空白 提交于 2019-11-29 22:06:00
问题 I get the same error relatively consistently when trying to install the stylish-haskell package off of hackage. The install went swimmingly until it got to installing conduit, which doesn't come anywhere near installing correctly. The ending of the error message: 17 warnings and 2 errors generated. Failed to install conduit-1.0.8 cabal: Error: some packages failed to install: conduit-1.0.8 failed during the building phase. The exception was: ExitFailure 1 stylish-haskell-0.5.8.0 depends on

Installing Haskell on Windows, cabal config

孤者浪人 提交于 2019-11-29 15:23:13
I'm installing Haskell on Windows based on the instructions at https://www.haskell.org/platform/ and looking at step 3, it says, Modify your cabal config file (you can verify the location by running "cabal user-config init") to contain the following lines: extra-prog-path: C:\Program Files\Haskell Platform\8.0.2\msys\usr\bin extra-lib-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\lib extra-include-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\include But the auto generated config file contains e.g. extra-prog-path: C:\Users\w\AppData\Roaming\cabal\bin So that's a different value

Cabal error: invalid preprocessing directive #-}

♀尐吖头ヾ 提交于 2019-11-29 14:36:43
$ cabal install arithmoi-0.4.0.3 results in multiple errors like: Math/NumberTheory/Moduli.hs:489:4: error: invalid preprocessing directive #-} ^ My System: OSX Mavericks Cabal version = 1.18.1.1 GHCI version = 7.6.3 Thanks in advance! Possible workaround here . xCode 5 comes with clang as c/c++/obj-c compiler. Haskell Platform is not ready for that. The next ghc release will fix that. Also see here . 来源: https://stackoverflow.com/questions/19597324/cabal-error-invalid-preprocessing-directive

Everywhere that GHC/Haskell Platform installs

╄→гoц情女王★ 提交于 2019-11-28 16:24:15
Assume I want to completely reinstall GHC/HP. I want to (as much for superstition as anything) delete anything and everything from previous installs. What do I actually need to delete (and where)? Edit: I'm on OSX, but I'm more curious if this information is available in general, for all systems. Edit2: So far we have: OSX: /Library/Frameworks/GHC.framework/ ~/.cabal/ /usr/bin/ -- symlinks I'll add to that (based on "prefix" defined here: http://www.vex.net/~trebla/haskell/sicp.xhtml#storage ): prefix/lib/ prefix/share/ prefix/bin/ prefix/share/doc/ /usr (/local) /lib/[ghc-version] /usr (

Cabal error: invalid preprocessing directive #-}

北慕城南 提交于 2019-11-28 08:09:18
问题 $ cabal install arithmoi-0.4.0.3 results in multiple errors like: Math/NumberTheory/Moduli.hs:489:4: error: invalid preprocessing directive #-} ^ My System: OSX Mavericks Cabal version = 1.18.1.1 GHCI version = 7.6.3 Thanks in advance! 回答1: Possible workaround here. xCode 5 comes with clang as c/c++/obj-c compiler. Haskell Platform is not ready for that. The next ghc release will fix that. Also see here. 来源: https://stackoverflow.com/questions/19597324/cabal-error-invalid-preprocessing

Everywhere that GHC/Haskell Platform installs

无人久伴 提交于 2019-11-27 09:52:33
问题 Assume I want to completely reinstall GHC/HP. I want to (as much for superstition as anything) delete anything and everything from previous installs. What do I actually need to delete (and where)? Edit: I'm on OSX, but I'm more curious if this information is available in general, for all systems. Edit2: So far we have: OSX: /Library/Frameworks/GHC.framework/ ~/.cabal/ /usr/bin/ -- symlinks I'll add to that (based on "prefix" defined here: http://www.vex.net/~trebla/haskell/sicp.xhtml#storage)