Skip to content

Instantly share code, notes, and snippets.

@ThomasCrevoisier
Created February 8, 2015 14:50
Show Gist options
  • Save ThomasCrevoisier/08c8895c1dcc45fd2a0d to your computer and use it in GitHub Desktop.
Save ThomasCrevoisier/08c8895c1dcc45fd2a0d to your computer and use it in GitHub Desktop.
Action class
module Exercises where
import Data.Monoid
class (Monoid m) <= Action m a where
act :: m -> a -> a
instance repeatAction :: Action Number String where
act 0 _ = ""
act n s = s ++ act (n - 1) s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment