Skip to content

Commit

Permalink
Just used deriving for the Data instance in Pad.
Browse files Browse the repository at this point in the history
  • Loading branch information
luqui committed Nov 18, 2008
1 parent 2cda6b5 commit 22ac75f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions udon-shell/UdonShell/Pad.hs
Expand Up @@ -9,13 +9,10 @@ import qualified Udon.DescCombinators as D
import qualified Data.Map as Map import qualified Data.Map as Map


newtype Pad = Pad { unPad :: Map.Map String DynRef } newtype Pad = Pad { unPad :: Map.Map String DynRef }
deriving (Typeable) deriving (Typeable, Data)


conj f = Pad . f . unPad conj f = Pad . f . unPad


instance Data Pad where
desc = D.wrap (Pad . Map.fromDistinctAscList, Map.toList . unPad) desc

insert :: String -> DynRef -> Pad -> Pad insert :: String -> DynRef -> Pad -> Pad
insert str ref = conj (Map.insert str ref) insert str ref = conj (Map.insert str ref)


Expand Down

0 comments on commit 22ac75f

Please sign in to comment.