Created
February 8, 2015 14:50
-
-
Save ThomasCrevoisier/08c8895c1dcc45fd2a0d to your computer and use it in GitHub Desktop.
Action class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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