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