################################################################## https://www.haskell.org/ https://en.wikipedia.org/wiki/Haskell_(programming_language) rigid: http://www.cis.upenn.edu/~cis194/spring13/lectures.html hard to get fluent: http://learnyouahaskell.com/syntax-in-functions ################################################################## ################################################################## Lambda calculus Lambda calculus definition https://en.wikipedia.org/wiki/Lambda_calculus_definition https://en.wikipedia.org/wiki/Lambda_calculus Beta-reduction https://en.wikipedia.org/wiki/Beta_normal_form https://en.wikipedia.org/wiki/Church%E2%80%93Rosser_theorem Summary?: A Tutorial Introduction to the Lambda Calculus http://www.inf.fu-berlin.de/lehre/WS03/alpi/lambda.pdf Simply_typed_lambda_calculus https://en.wikipedia.org/wiki/Simply_typed_lambda_calculus Type theory generic: https://en.wikipedia.org/wiki/Type_theory#Systems_of_type_theory useless?: https://en.wikipedia.org/wiki/Algebraic_data_type Prerequisites for mathematically alert people: https://en.wikipedia.org/wiki/Propositional_calculus#Example_1._Simple_axiom_system https://en.wikipedia.org/wiki/System_F https://en.wikipedia.org/wiki/Church_encoding#Church_Booleans System_F and GHC https://en.wikipedia.org/wiki/System_F GHC The Glasgow Haskell Compiler. Overview and Core-Language from designer. Informative and simple. https://www.microsoft.com/en-us/research/wp-content/uploads/2012/01/aos.pdf The Architecture of Open Source Applications, Volume 2 Simon Marlow Simon Peyton Jones March 16, 2012 Core-Language. Source code. https://ghc.haskell.org/trac/ghc/browser/ghc/compiler/coreSyn/CoreSyn.hs https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/FC System FC https://www.microsoft.com/en-us/research/wp-content/uploads/2007/01/tldi22-sulzmann-with-appendix.pdf System F with Type Equality Coercions Including post-publication Appendix January 19, 2011 Martin Sulzmann School of Computing National University of Singapore Manuel M. T. Chakravarty Computer Science & Engineering University of New South Wales Simon Peyton Jones Kevin Donnelly Microsoft Research Ltd https://people.mpi-sws.org/~skilpat/plerg/papers/harper-system-f-2up.pdf Chapter 20 Girard’s System F "...System F was introduced by Girard (1972) in the context of proof theory and by Reynolds (1974) in the context of programming languages. The concept of parametricity was originally isolated by Strachey, but was not fully developed until the work of Reynolds (1983). The description of para- metricity as providing “theorems for free” was popularized by Wadler (1989)..." http://www.cs.rice.edu/~javaplt/311/Readings/IntroToSystemF.pdf The Cube of Lambda ... Quick Intuition on System F https://cubeoflambda.wordpress.com/2011/10/01/system-f/ The Girard-Reynolds Isomorphism (second edition) Philip Wadler https://homepages.inf.ed.ac.uk/wadler/papers/gr2/gr2.pdf https://crypto.stanford.edu/~blynn/lambda/systemf.html Monads and further theory: -- very good: https://www.haskell.org/tutorial/monads.html -- [10] P. Wadler. Monads for Functional Programming In Advanced Functional Programming , Springer Verlag, LNCS 925, 1995 -- http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf -- other links: https://www.haskell.org/tutorial/haskell-tutorial.html#$wadler:mffp -- can be rich: http://homepages.inf.ed.ac.uk/wadler/topics/monads.html Types: Haskell/Polymorphism https://en.wikibooks.org/wiki/Haskell/Polymorphism ################################################################## sudo apt-get install haskell-platform $ ghc --numeric-version 7.10.3 $ get started: 0) ################ start interpreter stan@ubu:/var/www/html/sand/DEV/lang/haskel$ ghci GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help Prelude> "moo" "moo" Prelude> :quit Leaving GHCi. stan@ubu:/var/www/html/sand/DEV/lang/haskel$ 1) ################ loading file into console-interpreter Prelude> :load 1-factorial/fact.hs ...details: GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help Prelude> :load 1-factorial/fact.hs [1 of 1] Compiling Main ( 1-factorial/fact.hs, interpreted ) Ok, modules loaded: Main. *Main> fac 6 720 *Main> 2) ################ making exe: do ghc -o fact-to-compile fact-to-compile.hs and run: ./fact-to-compile or ghc --make helloworld and run ./helloworld 3) ######### interpreter's first pitfals: $ ghci -- this is wrong: x = 9 -- this is right let x = 9 Pitfall: this fails: with error: "Not in scope: ‘x’" x :: Int to define function in console, use "let": Prelude> let fac n = if n == 0 then 1 else n * fac (n-1) Prelude> fac 3 6 4) ######### loaded file first pitfals: make file: mics.hs: x :: Int x = 9 main = print x -- looks "insane" ... works only when "main = pri..." is added stan@ubu:/var/www/html/sand/DEV/lang/haskel/3-misc$ ghc -o misc misc.hs; ./misc 5) ######### hello factorial: make file: fac n = if n == 0 then 1 else n * fac (n-1) 6) run on-fly: cd haskell/1-hellows$ runhaskell hello-on-fly.hs ########### more ################## 1) understanding print, sequence, mapM, mapM_ is a must http://learnyouahaskell.com/input-and-output#files-and-streams 2) ######### then? follow this tutor: (*)