I\'m completely new to Haskell. To grasp the basics I\'ve started working through \'Learn you a Haskell for Great Good\'. I\'m stuck on the simple matter of loading a function from a file.
Is开发者_运维知识库 there a Haskell interpreter that accepts type definitions or preferably all kinds of statements?
This question arose on #haskell irc chat: How can I start ghci without importing prelude? The possible answer seemed obvious:
I create a simple module, TestModule.hs, which contains a single exported top-level definition testval = 2. I compile it, creating TestModule.o and TestModule.hi. I delete TestModule.hs. I the开发者_如
I\'m trying out cabal-dev for a project I\'m working on; the project is a library, and cabal-dev does a great job of building a sandboxed version of it - but I\'m having trouble with part of my workfl
Basically when I :load name.hs the variables and bindings are gone. Is there some option to tell g开发者_JS百科hci keep it all?To load a new module, you can use
The following returns True (because 2147483647 is a prime). length [f | f <- [2..(floor(sqrt 2147483647))], 2147483647 `mod` f == 0 ] == 0
Is it possible to interact with arbitrary Monad instances incrementally at the GHCi 开发者_JAVA百科prompt?
Ok, I\'ve been using the -i compile option to specify the folder to some haskell source when I compile using GHC.
For example, take the code written by Don Stewart in reply to some Stack Overflow question: import Control.Monad