Restructure files

This commit is contained in:
Julian Ospald
2015-04-20 00:51:14 +02:00
parent aa66512620
commit 1075baf401
79 changed files with 149 additions and 149 deletions

53
common/code/Code.hs Normal file
View File

@@ -0,0 +1,53 @@
module Code where
data WeekDay = Monday
| Tuesday
| Thursday
| Wednsday
| Friday
| Saturday
| Sunday
deriving (Show)
f :: Int -> Int -> Int
f x 0 = 1
f x y = x * f x (y - 1)
mod2 :: Int -> Int
mod2 x
| x - 2 == 0 = 0
| x - 2 < 0 = x
| otherwise = mod2 (x - 2)
week :: [WeekDay]
week = [Monday, Tuesday, Thursday, Wednsday
, Friday, Saturday, Sunday]
isMonday :: WeekDay -> Bool
isMonday Monday = True
isMonday x = False
data Tree = Leaf Char
| Node Tree Int Tree
deriving Show
data MaybeInt = NoError Int
| Error String
calcSomething :: Int -> MaybeInt
calcSomething x
| x < 100 = NoError (x * 5)
| otherwise = Error "Int out of range!"
f' :: Int -> Int
f' x = let y p = x + p
in x + (y 2)
addTwo :: [Int] -> [Int]
addTwo [] = []
addTwo (x:xs) = (x + 2) : addTwo xs
f'' :: String -> Bool
f'' xs = even . length . (\x -> x ++ "Hello world") $ xs

View File

@@ -0,0 +1,8 @@
\begin{itemize}
\item the most popular haskell course from Brent Yorgey:\\ \url{https://www.seas.upenn.edu/~cis194/fall14/spring13/lectures.html}
\item very verbose and enthusiastic haskell book, good for reading once:\\ \url{http://learnyouahaskell.com}
\item collection of websites teaching haskell:\\ \url{https://github.com/bitemyapp/learnhaskell}
\item haskell programming tips (and wiki):\\ \url{https://wiki.haskell.org/Haskell_programming_tips}
\item the standard module (similar to libc in C):\\ \url{https://hackage.haskell.org/package/base-4.7.0.0/docs/Prelude.html}
\item debugging in haskell:\\ \url{https://wiki.haskell.org/Debugging}
\end{itemize}

View File

@@ -0,0 +1,6 @@
\begin{itemize}
\item much content was borrowed or is based on the haskell course from Brent Yorgey:\\ \url{https://www.seas.upenn.edu/~cis194/fall14/spring13/lectures.html}
\item a few small pieces from the LYAH book \url{http://learnyouahaskell.com}
\item general information from wikipedia: \\ \url{https://en.wikipedia.org}
\item general information from haskell wiki: \\ \url{https://wiki.haskell.org}
\end{itemize}