Copyright | (c) Hisaket VioletRed 2022 |
---|---|
License | AGPL-3.0-or-later |
Maintainer | hisaket@outlook.jp |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data GetPosition pos m a where
- GetPosition :: GetPosition pos m pos
- getPosition :: forall pos r. Member (GetPosition pos) r => Sem r pos
- data TriPosition
- = End Ends
- | Intermediate
- data Ends
- data Seek pos m a where
- seek :: forall pos r. Member (Seek pos) r => pos -> Sem r ()
- newtype Absolute a = Absolute a
- newtype Relative a = Relative a
- newtype FromEnd a = FromEnd a
- data Read sz i m a where
- read :: forall sz i r. Member (Read sz i) r => sz -> Sem r i
- type ReadToEnd = Read ToEnd
- data ToEnd = ToEnd
- data NullSize = NullSize
- inputToRead :: Member (Read sz i) r => sz -> Sem (Input i ': r) a -> Sem r a
- data Overwrite o m a where
- overwrite :: forall o r. Member (Overwrite o) r => o -> Sem r ()
- outputToOverwrite :: Member (Overwrite o) r => Sem (Output o ': r) a -> Sem r a
- data Extend o m a where
- extend :: forall o r. Member (Extend o) r => o -> Sem r ()
- data Append o m a where
- append :: forall o r. Member (Append o) r => o -> Sem r ()
- outputToExtend :: Member (Extend o) r => Sem (Output o ': r) a -> Sem r a
- outputToAppend :: Member (Append o) r => Sem (Output o ': r) a -> Sem r a
- data Resize sz m a where
- resize :: forall sz r. Member (Resize sz) r => sz -> Sem r ()
Documentation
data GetPosition pos m a where Source #
An effect that gets the current cursor position in the file.
GetPosition :: GetPosition pos m pos |
getPosition :: forall pos r. Member (GetPosition pos) r => Sem r pos Source #
data TriPosition Source #
A type that represents both ends or intermediate positions in the file.
Instances
Eq TriPosition Source # | |
Defined in Polysemy.SequentialAccess (==) :: TriPosition -> TriPosition -> Bool # (/=) :: TriPosition -> TriPosition -> Bool # | |
Ord TriPosition Source # | |
Defined in Polysemy.SequentialAccess compare :: TriPosition -> TriPosition -> Ordering # (<) :: TriPosition -> TriPosition -> Bool # (<=) :: TriPosition -> TriPosition -> Bool # (>) :: TriPosition -> TriPosition -> Bool # (>=) :: TriPosition -> TriPosition -> Bool # max :: TriPosition -> TriPosition -> TriPosition # min :: TriPosition -> TriPosition -> TriPosition # | |
Show TriPosition Source # | |
Defined in Polysemy.SequentialAccess showsPrec :: Int -> TriPosition -> ShowS # show :: TriPosition -> String # showList :: [TriPosition] -> ShowS # |
A type that represents both ends of the file.
A wrapper type that represents an absolute position in the file.
Absolute a |
Instances
Eq a => Eq (Absolute a) Source # | |
Ord a => Ord (Absolute a) Source # | |
Show a => Show (Absolute a) Source # | |
A wrapper type that represents relative position from the current cursor position.
Relative a |
Instances
Eq a => Eq (Relative a) Source # | |
Ord a => Ord (Relative a) Source # | |
Show a => Show (Relative a) Source # | |
A wrapper type that represents relative position from the end of the file.
FromEnd a |
data Read sz i m a where Source #
An effect that gets file contents by the size sz
from the current
position.
type ReadToEnd = Read ToEnd Source #
An effect that gets file contents from current position to the end of the file.
A singleton that represents the size from the current position to the end of the file.
A singleton that represents the size 0.
data Overwrite o m a where Source #
An effect that overwrites file contents by the data o
from current
position.
data Extend o m a where Source #
An effect that extends a file by the data o
from the end of a file.
The cursor is not moved.
data Append o m a where Source #
An effect that extends a file by the data o
from the end of a file.
The cursor is moved to the end of the file after extending.