Find it here: https://github.com/bitemyapp/learnhaskell
| 13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| | FUCKIN PUSSIES | |
| 13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
| 13:16 <luite> | hello | |
| 13:16 <ChongLi> | somebody has a mental illness! | |
| 13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| | compelled to write Node.js! | |
| 13:16 <genisage> | hi | |
| 13:16 <luite> | you might be pleased to learn that you can compile | |
| | haskell to javascript now |
| (declare numbero*) | |
| (defn symbolo* [x] | |
| (reify | |
| IConstraintStep | |
| (-step [this s] | |
| (reify | |
| clojure.lang.IFn | |
| (invoke [_ s] | |
| (let [x (walk s x)] |
| (ns turel.core | |
| (:refer-clojure :exclude [==]) | |
| (:use clojure.core.logic)) | |
| (defn not-membero | |
| [x l] | |
| (conde [(emptyo l)] | |
| [(fresh [head tail] | |
| (conso head tail l) | |
| (!= head x) |
| snakeToCamel: (s) -> | |
| s.replace(/(_\w)/g, (m) -> return m[1].toUpperCase() ) | |
| snakeToUpperCamel: (s) -> | |
| s.charAt(0).toUpperCase() + s.slice(1).replace(/(_\w)/g, (m) -> return m[1].toUpperCase() ) |
| ///////////////////////////////////////////////////// | |
| // | |
| // Moved to repository: | |
| // https://github.com/Oregu/_.java | |
| // | |
| ///////////////////////////////////////////////////// | |
| import java.util.function.BiFunction; | |
| import java.util.function.Function; |
| (* How do to topology in Coq if you are secretly an HOL fan. | |
| We will not use type classes or canonical structures because they | |
| count as "advanced" technology. But we will use notations. | |
| *) | |
| (* We think of subsets as propositional functions. | |
| Thus, if [A] is a type [x : A] and [U] is a subset of [A], | |
| [U x] means "[x] is an element of [U]". | |
| *) | |
| Definition P (A : Type) := A -> Prop. |
| {-# OPTIONS_GHC -fwarn-incomplete-patterns #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FlexibleContexts #-} |
In response to this reddit post about failing to understand the Pipes library after a couple of hours. I wanted to show how an experienced haskeller does it, but I'm afraid it also took me quite a few hours, which is why the following list of steps goes on and on.
After all those hours, my opinion is that Pipes is not at all an easy library. I don't know if Conduit is any easier, but otherwise I side with your friend in advising to use something else (perhaps ordinary lazy IO?) instead of Pipes.
Anyway, here is the full brain dump of my steps as I tried to get your three snippets to fit together.
- Since you say that you have a hard time combining the snippets, I assume that they must have complicated types. So my first goal is to figure out the type of your first snippet.
- hoogle for
parseUrl,withManager, etc. No results. - Google for
haskell runEffect, find that it's a method fromPipes.Core,
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.