1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# OPTIONS_GHC -fno-warn-orphans #-}
6 module Hcompta.Lib.Consable where
8 --import Control.Applicative (Const(..))
9 import Data.Functor.Compose (Compose(..))
10 import Data.Monoid (Monoid(..))
12 class Monoid (xs x) => Consable context xs x where
13 mcons :: context -> x -> xs x -> xs x
15 instance Monoid (f (g x)) => Monoid ((Compose f g) x) where
16 mempty = Compose mempty
17 mappend (Compose x) (Compose y) = Compose (mappend x y)