- Notifications
You must be signed in to change notification settings - Fork1
FACSKELL/Lecture-1
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
FACSKELL is the Founders & Coders Haskell Club. We are currently learning Haskell by readingCIS 194: Introduction to Haskell (Spring 2013) byBrent Yorgey. We are also learning from other books:
Find and post your questions onReddit Haskell,Reddit Haskell Questions or onStackoverflow
For a more detail list of documentation you can have a look at theHaskell website
Because learning Haskell is cool!
Haskell is:
- Functional
- Pure
- Immutable
- No side effects
- A same function with the same arguments will return the same outputs
- Lazy
- Typed
Haskell has the usual types : Bool, Int, Integer, Char, String. The Char type is represented with single quote 'C', the Sting type is represented with double quotes "myString". Haskell has also some more useful types:
- Pairs:
p:: (Int,Char)
- List:
l:: [Integer]-- a list is a head and a tail (x:xs)
You can use the keywordtype to create an alias for a type.
typeSt=Stringf::St->St
You can create a new type with the keyworddata:
dataTree=Empty |LeafInt |NodeTreeTree
Here we create thetype constructor Tree whith the followingdata constructors:
- Empty
- Leaf Int
- Node Tree Tree
Leaf and Node take parameters!type constructor and data constructor must begin with a capital letter!
You can combine functions:
myOtherFunc (myFirstFunc a)
Two useful operators:
. Which correspond to the mathematic composition. The result of the fist function become the input of the second function
(myOtherFunc. myFirstFunc) a
$ Replace parenthesis. Everything after $ will be executed before the things before the $ (everything after $ has a higher precedence)
myOtherFunc$ myFirstFunc a
Haskell load by default the Prelude module which contains a lot of useful functions
You can find all the documentation of Haskell on Hoogle
About
One way of solving some exercises
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Contributors2
Uh oh!
There was an error while loading.Please reload this page.