-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
65 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Binrep.Via.Prim where | ||
|
||
-- | DerivingVia newtype for types which can borrow from 'Prim''. | ||
newtype ViaPrim a = ViaPrim { unViaPrim :: a } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Raehik.Compat.FlatParse.Basic.Prim where | ||
|
||
import Raehik.Compat.Data.Primitive.Types | ||
import FlatParse.Basic | ||
import GHC.Exts ( plusAddr# ) | ||
|
||
anyPrim :: forall a e st. Prim' a => ParserT st e a | ||
anyPrim = withEnsure# size# $ ParserT $ \_fp _eob buf st -> | ||
OK# st (indexWord8OffAddrAs# buf 0#) (buf `plusAddr#` size#) | ||
where | ||
size# = sizeOf# (undefined :: a) |