okasaki

Okasaki's Purely Functional Data Structures
git clone git://git.jtobin.io/okasaki.git
Log | Files | Refs | LICENSE

Orphans.hs (331B)


      1 {-# OPTIONS_GHC -Wall -fno-warn-orphans #-}
      2 
      3 module Okasaki.Orphans where
      4 
      5 import Data.Functor.Const
      6 import Data.Functor.Foldable
      7 import qualified Data.Monoid as M
      8 
      9 type instance Base (M.Last a) = Const (M.Last a)
     10 
     11 instance Corecursive (M.Last a) where
     12   embed (Const s) = s
     13 
     14 instance Recursive (M.Last a) where
     15   project = Const
     16