2005-11-28から1日間の記事一覧

map (\xs -> zip xs [1..]) list

とりあえず入力。 Prelude List> map (\xs -> zip xs [1..]) list :1:26: Not in scope: `list' listなんて作ってないもんな・・・ Prelude List> map (\xs -> zip xs [1..]) [1,2] :1:27: No instance for (Num [a]) arising from the literal `1' at :1:27…

\x -> x + 1

Tour of the Haskell Syntax http://www.cs.uu.nl/~afie/haskell/tourofsyntax.html の Anonymous function can be made using lambda expressions. For example \x -> x + 1is a function with one parameter which it will add one to. Lambda expressions…

Tour of the Haskell Syntax

http://www.cs.uu.nl/~afie/haskell/tourofsyntax.html#Lambda%20expressions をやってみる。