OpenAFP 1.1 → 1.2
raw patch · 4 files changed
+7/−7 lines, 4 files
Files
- LICENSE +1/−1
- OpenAFP.cabal +1/−1
- src/OpenAFP/Prelude/Utils.hs +2/−2
- src/OpenAFP/Types/Chunk.hs +3/−3
LICENSE view
@@ -1,4 +1,4 @@-The "MIT" License+Copyright 2004-2008 by Audrey Tang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
OpenAFP.cabal view
@@ -1,5 +1,5 @@ Name: OpenAFP-Version: 1.1+Version: 1.2 License: BSD3 License-file: LICENSE Author: Audrey Tang
src/OpenAFP/Prelude/Utils.hs view
@@ -104,10 +104,10 @@ fromJust'' (Just x) = x fromJust'' Nothing = error "fromJust2 - fail" -matchRecord :: (RecData a b, Eq c) => c -> (b -> c) -> a -> b+matchRecord :: (DataOf a ~ b, RecOf b ~ a, RecData a b, Eq c) => c -> (b -> c) -> a -> b matchRecord n f = findRecord ((n ==) . f) . readData -matchRecordMaybe :: (RecData a b, Eq c) => c -> (b -> c) -> a -> Maybe b+matchRecordMaybe :: (DataOf a ~ b, RecOf b ~ a, RecData a b, Eq c) => c -> (b -> c) -> a -> Maybe b matchRecordMaybe n f = findRecordMaybe ((n ==) . f) . readData findRecordMaybe :: (a -> Bool) -> [Record a] -> Maybe a
src/OpenAFP/Types/Chunk.hs view
@@ -125,12 +125,12 @@ -- | The RecData class unifies a Rec (parent) with its contained -- Rec data type (children).-class (Rec a, Rec b, DataOf a ~ b, RecOf b ~ a) => RecData a b where+class (Rec a, Rec b) => RecData a b where type DataOf a type RecOf b- readData :: a -> [Record b]+ readData :: (DataOf a ~ b, RecOf b ~ a) => a -> [Record b] readData = error "readData not defined"- writeData :: a -> [Record b] -> a+ writeData :: (DataOf a ~ b, RecOf b ~ a) => a -> [Record b] -> a writeData = error "writeData not defined" instance (Rec a, Binary a) => Storable [a] where