Skip to content

Instantly share code, notes, and snippets.

View hsalokor's full-sized avatar

Harri Salokorpi hsalokor

  • Reaktor Oy
  • Helsinki
View GitHub Profile
@komu
komu / river.lhs
Last active September 27, 2015 17:38
Crossing a river with Haskell
> {-# OPTIONS -Wall -XMultiParamTypeClasses -XFunctionalDependencies -XTypeSynonymInstances #-}
> module Main where
8 people are standing on a west bank of a river and must cross to the
other side using a boat. However,
- the boat carries at most 2 people at a time,
- the father can't be left with the girls without the mother,
- the mother can't be left with the boys without the father,
- the prisoner can't be left with any family members without the police,