| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Binrep.Type.Thin
Description
Thin types which reference the parser input when gotten via Get.
flatparse's take family perform no copying-- instead, a bytestring is
manually constructed with the finalizer from the input bytestring. I'm not sure
I want this -- it sounds like a memory leak waiting to happen -- so I default to
copying to a new bytestring. This type allows recovering the efficient no-copy
behaviour.
TODO doing this the other way around would be simpler, and fit flatparse better. All we need is such a class:
class Copy a where copy :: a -> a instance Copy B.ByteString where copy = B.copy
But this just doesn't fly, because it would invert the behaviour.
Documentation
Instances
| Data a => Data (Thin a) Source # | |||||
Defined in Binrep.Type.Thin Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Thin a -> c (Thin a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Thin a) # toConstr :: Thin a -> Constr # dataTypeOf :: Thin a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Thin a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Thin a)) # gmapT :: (forall b. Data b => b -> b) -> Thin a -> Thin a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Thin a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Thin a -> r # gmapQ :: (forall d. Data d => d -> u) -> Thin a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Thin a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Thin a -> m (Thin a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Thin a -> m (Thin a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Thin a -> m (Thin a) # | |||||
| IsString a => IsString (Thin a) Source # | |||||
Defined in Binrep.Type.Thin Methods fromString :: String -> Thin a # | |||||
| Monoid a => Monoid (Thin a) Source # | |||||
| Semigroup a => Semigroup (Thin a) Source # | |||||
| Generic (Thin a) Source # | |||||
Defined in Binrep.Type.Thin Associated Types
| |||||
| IsList a => IsList (Thin a) Source # | |||||
| Read a => Read (Thin a) Source # | |||||
| Show a => Show (Thin a) Source # | |||||
| BLen a => BLen (Thin a) Source # | |||||
| Get (Thin ByteString) Source # | |||||
Defined in Binrep.Type.Thin | |||||
| Put a => Put (Thin a) Source # | |||||
| GetSize (Thin ByteString) Source # | |||||
Defined in Binrep.Type.Prefix.Size | |||||
| NFData a => NFData (Thin a) Source # | |||||
Defined in Binrep.Type.Thin | |||||
| Eq a => Eq (Thin a) Source # | |||||
| Ord a => Ord (Thin a) Source # | |||||
| Strengthen (Thin a) Source # | |||||
Defined in Binrep.Type.Thin Methods strengthen :: Weak (Thin a) -> Either StrengthenFailure' (Thin a) # | |||||
| Weaken (Thin a) Source # | |||||
| type Rep (Thin a) Source # | |||||
Defined in Binrep.Type.Thin | |||||
| type Item (Thin a) Source # | |||||
Defined in Binrep.Type.Thin | |||||
| type Weak (Thin a) Source # | |||||
Defined in Binrep.Type.Thin | |||||