git.iko.soy/typeable/flat-instances
on 1478d52 help sign in
3 files changed+1−35
since splitsnapshots
unifiedsplit
flat-instances.cabal−13 src/Flat/Orphans.hs+1−3 src/Flat/Servant.hs−19
flat-instances.cabal−13
@@ -4,11 +4,6 @@ name: flat-instances
44version: 0.1.0.0
55license-file: LICENSE
66
7−Flag flat-servant
8− Description: Enable Flat serialization support
9− Default: True
10− Manual: False
11−
127library
138 exposed-modules:
149 Flat.Orphans
@@ -16,14 +11,6 @@ library
1611 base,
1712 flat,
1813 time,
19− vector
20− if flag(flat-servant)
21− exposed-modules:
22− Flat.Servant
23− build-depends:
24− bytestring,
25− servant
26−
2714 hs-source-dirs:
2815 src
2916 default-language:
src/Flat/Orphans.hs+1−3
@@ -3,11 +3,11 @@
33{-# LANGUAGE StandaloneDeriving #-}
44{-# OPTIONS_GHC -fno-warn-orphans #-}
55
6+
67module Flat.Orphans where
78
89import Data.Fixed
910import Data.Time
10−import Data.Vector
1111import Flat as F
1212
1313
@@ -65,5 +65,3 @@ instance Flat ZonedTime where
6565 size = F.size . zonedTimeToTuple
6666 encode = F.encode . zonedTimeToTuple
6767 decode = uncurry ZonedTime <$> F.decode
68−
69−deriving via (AsArray (Vector a)) instance Flat a => Flat (Vector a)
src/Flat/Servant.hsdeleted−19
@@ -1,19 +0,0 @@
1−{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, OverloadedStrings #-}
2−module Flat.Servant where
3−
4−import Data.Bifunctor
5−import Data.ByteString.Lazy
6−import Flat as F
7−import Servant.API
8−
9−
10−data FlatBinary
11−
12−instance Accept FlatBinary where
13− contentType _ = "application/octet-stream"
14−
15−instance Flat a => MimeRender FlatBinary a where
16− mimeRender _ = fromStrict . F.flat
17−
18−instance Flat a => MimeUnrender FlatBinary a where
19− mimeUnrender _ = first show . F.unflat