Initial commit
This commit is contained in:
commit
c101616e62
309 changed files with 53937 additions and 0 deletions
20
bundled/Basement/Alg/Class.hs
Normal file
20
bundled/Basement/Alg/Class.hs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{-# LANGUAGE BangPatterns #-}
|
||||
{-# LANGUAGE DeriveDataTypeable #-}
|
||||
{-# LANGUAGE TypeFamilies #-}
|
||||
{-# LANGUAGE RebindableSyntax #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||
|
||||
module Basement.Alg.Class
|
||||
( Indexable, index
|
||||
, RandomAccess, read, write
|
||||
) where
|
||||
|
||||
import Basement.Types.OffsetSize
|
||||
|
||||
class Indexable container ty where
|
||||
index :: container -> (Offset ty) -> ty
|
||||
|
||||
class RandomAccess container prim ty where
|
||||
read :: container -> (Offset ty) -> prim ty
|
||||
write :: container -> (Offset ty) -> ty -> prim ()
|
||||
Loading…
Add table
Add a link
Reference in a new issue