Commit 0d0e651d authored by Ben Gamari's avatar Ben Gamari 🐢

Bag: Add Foldable instance

parent a146b282
......@@ -29,6 +29,7 @@ import Util
import MonadUtils
import Data.Data
import Data.List ( partition )
import qualified Data.Foldable as Foldable
infixr 3 `consBag`
infixl 3 `snocBag`
......@@ -269,3 +270,6 @@ instance Data a => Data (Bag a) where
gunfold _ _ = error "gunfold"
dataTypeOf _ = mkNoRepType "Bag"
dataCast1 x = gcast1 x
instance Foldable.Foldable Bag where
foldr = foldrBag
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment