
Hi, I am trying to run the following from the GHCi command prompt which results in parse error. -------------- Prelude> :{ Prelude| foo :: Maybe String Prelude| foo = do Prelude| x <- Just 3 Prelude| y <- Just "!" Prelude| Just (show x ++ y) Prelude| :} <interactive>:145:5: parse error on input `=' --------------- Any help would be appreciated. Thanks, Shishir

On Wed, Apr 15, 2015 at 12:21 PM, Shishir Srivastava < shishir.srivastava@gmail.com> wrote:
I am trying to run the following from the GHCi command prompt which results in parse error.
ghci is not ghc, and requires `let`
-------------- Prelude> :{ Prelude| foo :: Maybe String Prelude| foo = do Prelude| x <- Just 3 Prelude| y <- Just "!" Prelude| Just (show x ++ y) Prelude| :}
<interactive>:145:5: parse error on input `=' ---------------
Any help would be appreciated.
Thanks, Shishir
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Either(!) its TAB characters upsetting things or not possible form the
command line. Maybe(!!) try saving to a file then using the load command to
do it instead.
On 15 April 2015 at 17:21, Shishir Srivastava
Hi,
I am trying to run the following from the GHCi command prompt which results in parse error.
-------------- Prelude> :{ Prelude| foo :: Maybe String Prelude| foo = do Prelude| x <- Just 3 Prelude| y <- Just "!" Prelude| Just (show x ++ y) Prelude| :}
<interactive>:145:5: parse error on input `=' ---------------
Any help would be appreciated.
Thanks, Shishir
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

On Wed, Apr 15, 2015 at 12:21 PM, Shishir Srivastava < shishir.srivastava@gmail.com> wrote:
I am trying to run the following from the GHCi command prompt which results in parse error.
Urgh, sorry. ghci is not ghc, and requires `let` even in the multi-line mode. :{ let foo :: Maybe String foo = do x <- Just 3 y <- Just "!" Just (show x ++ y) :} In general, you are better off using files for definitions, and treat the prompt as a debugger or desk calculator. Multi-line mode doesn't really change this. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (3)
-
Brandon Allbery
-
emacstheviking
-
Shishir Srivastava