Re:Try Haskell: An interactive tutorial in your browser
by nandemo on Wednesday March 27, 2013 @08:21AM
(#5448941)
That works on ghci but, unfortunately, Try Haskell doesn't seem to support let.
Re:Try Haskell: An interactive tutorial in your browser
by jonke on Wednesday March 27, 2013 @08:43AM
(#5449033)
TryHaskell uses http://hackage.haskell.org/package/mueval and not ghci
You can eval expression so following works
let t ="foo" in t
Re:Try Haskell: An interactive tutorial in your browser
by nandemo on Wednesday March 27, 2013 @09:12AM
(#5449155)
Yeah, I saw that it uses mueval, but it's still conceivable that TryHaskell itself could hack support for let on top of it. Apparently Chris planned to do it [1].
Note that in "let t=bar in foo" the scope of t is restricted to foo, so the example above still doesn't work.
[1] http://www.reddit.com/r/haskell/comments/b58rk/try_haskell/c... ([deleted] = Chris Doner)
Re:Try Haskell: An interactive tutorial in your browser
by jonke on Wednesday March 27, 2013 @09:49AM
(#5449341)
Fair enough but you could do let f = map reverse in f ["ab", "cd"]
IMHO the tryhaskell expose more or less only simple pure functions and I doubt that anyone with a real interest in haskell will get any substantial out of it. However if one is completely new to programming maybe TryHaskell and these 6 short lessons have a value.
> let f = map reverse
> f [[1,2,3], [6,7,8]]
EDIT: scratch the "let" example (thanks nandemo), tryhaskell.org doesn't support that. my bad!