Skip to content

Commit

Permalink
Haskell Seminar KickOff
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgimeno committed Sep 25, 2019
1 parent 1eb5105 commit 1945200
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 24 deletions.
Binary file not shown.
5 changes: 1 addition & 4 deletions funprog/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
Slides for the talk "A (personal) introduction to Functional Programming"
performed by Juan Manuel Gimeno at the
[Lleida Developers Meetup](http://www.meetup.com/es-ES/Lleida-Developers/events/228749232/)
on Feb 25, 2016.
Slides for the kickoff of the Haskell Seminar (2019-2010 edition)
Binary file added funprog/images/idris.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 58 additions & 20 deletions funprog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ <h2>Clojure / ClojureScript</h2>
<li>core.async: channels and goroutines</li>
<li>React.js: reagent, om, om.next, ...</li>
<li>Datomic: the database as a value</li>
<li>But no static typing</li>
</ul>
</section>

Expand Down Expand Up @@ -303,15 +304,8 @@ <h2>Scala</h2>
<li>Advanced libraries: Scalaz & Cats</li>
<li>Advanced frameworks: Akka & Play</li>
<li>Haskell-ish but practical</li>
<li>Reactive Manifesto (2.0)
<ul>
<li>Responsive</li>
<li>Resilient</li>
<li>Elastic</li>
<li>Message-driven</li>
</ul>
</li>

<li>But clumsy syntax</li>
<li>Scala 2 -> Scala 3</li>
</ul>
</section>

Expand Down Expand Up @@ -356,11 +350,63 @@ <h2>Haskell</h2>
<li>Pattern matching</li>
<li><a href="https://wiki.haskell.org/Typeclassopedia">Typeclassopedia</a>: Functors, Applicatives, Monads, ...</li>
<li>The IO Monad !!!</li>
<li>Very interesting typesystem</li>
</ul>
</section>

</section>

<section>

<section>
<h2>Liquid Haskell</h2>
<pre class="stretch"><code class="hljs" class="haskell" data-trim contenteditable>
{-@ type IncrList a = [a]<{\xi xj -> xi <= xj}> @-}

split :: [a] -> ([a], [a])
split (x:y:zs) = (x:xs, y:ys)
where
(xs, ys) = split zs
split xs = (xs, [])

{-@ merge :: (Ord a) => IncrList a
-> IncrList a
-> IncrList a
@-}

merge xs [] = xs
merge [] ys = ys
merge (x:xs) (y:ys)
| x <= y = x : merge xs (y:ys)
| otherwise = y : merge (x:xs) ys

{-@ mergeSort :: (Ord a) => [a] -> IncrList a @-}

mergeSort [] = []
mergeSort [x] = [x]
mergeSort xs = merge (mergeSort ys) (mergeSort zs)
where
(ys, zs) = split xs
</code></pre>
</section>

<section>
<h2>Liquid Haskell</h2>
<ul>
<li>Refinement types: HaskellTypes + Predicates</li>
<li>Uses a SMT (Solver Module Theories)</li>
<li>So more invariants can be checked at compile time
<ul>
<li>Guarantee totality</li>
<li>Vector access bounds</li>
<li>Avoid infinite loops</li>
<li>...</li></ul>
</li>
</ul>
</section>

</section>

<section>

<section>
Expand All @@ -386,8 +432,8 @@ <h2>Idris</h2>
<h2>Idris</h2>
<ul>
<li>Similar to Haskell but strictly evaluated</li>
<li>Dependent types</li>
<li>... don't know much more yet ...</li>
<li>Dependent types !!!</li>
<li>Idris 2 on the making</li>
</ul>
</section>

Expand Down Expand Up @@ -451,20 +497,12 @@ <h2>Suggested books</h2>

<section>
<h2>Suggested books</h2>
<img width="240" height="350" src="images/idris.jpg" alt="Type-Driven Development with Idris" />
<img width="240" height="350" src="images/idris.png" alt="Type-Driven Development with Idris" />
<p>
<a href="https://www.manning.com/books/type-driven-development-with-idris">Type-Driven Development with Idris</a>
</p>
</section>

<section>
<h2>Suggested books</h2>
<img width="240" height="350" src="images/frdm.jpg" alt="Functional and Reactive Domain Modeling" />
<p>
<a href="https://www.manning.com/books/functional-and-reactive-domain-modeling">Functional and Reactive Domain Modeling</a>
</p>
</section>

</section>

<section>
Expand Down

0 comments on commit 1945200

Please sign in to comment.