haskell learning beginner

来源:互联网 发布:笔趣阁软件 编辑:程序博客网 时间:2024/06/04 19:33
1.factorial n = foldl (*) 1 [1..n]
  Universell verwendbare Bausteine wie:
  foldl :: (a->b->a)->a->[b]->a
a->b: function
a:type
[b]:type
a:Ausgabe

2. stack installieren
> stack new MyProject new-template
>cd MyProject
> stack setup
> stack  build   # projekt kompilieren und ausführen
>stack exec MyProject -exe #somFunc
>stack exec -- ghc Foo.hs # wenn nicht funktioniert ,kann man darunter:
>stack exec -- runghc Foo.hs #nicht compliert .
>stack ghci

auch
GHC installieren:Glasgow Hakell Kompiler(Normaler Kompiler)
ghci(Interpreter Modus)




原创粉丝点击