Module

Data.List.Pointed

Package
purescript-pointed-list
Repository
paluh/purescript-pointed-list

#Pointed Source

newtype Pointed a

Constructors

Instances

#fromFoldable Source

fromFoldable :: forall f a. Foldable f => f a -> Maybe (Pointed a)

Build and set focus at the end.

#singleton Source

singleton :: forall a. a -> Pointed a

#next Source

next :: forall a. Pointed a -> Maybe (Pointed a)

#prev Source

prev :: forall a. Pointed a -> Maybe (Pointed a)

#replace Source

replace :: forall a. a -> Pointed a -> Pointed a

#insertLeft Source

insertLeft :: forall a. a -> Pointed a -> Pointed a

Insert element before current focus and move focus to the new one.

#insertRight Source

insertRight :: forall a. a -> Pointed a -> Pointed a

#deleteLeft Source

deleteLeft :: forall a. Pointed a -> Maybe (Pointed a)

Delete current focus and move to the left if possible.

#deleteRight Source

deleteRight :: forall a. Pointed a -> Maybe (Pointed a)

Delete current focus and move to the right if possible.

#moveLeft Source

moveLeft :: forall a. Pointed a -> Maybe (Pointed a)

#moveRight Source

moveRight :: forall a. Pointed a -> Maybe (Pointed a)

#dropPrefix Source

dropPrefix :: forall a. Pointed a -> Pointed a

#dropSuffix Source

dropSuffix :: forall a. Pointed a -> Pointed a

#first Source

first :: forall a. Pointed a -> Pointed a

Change focus so it points at first element.

#last Source

last :: forall a. Pointed a -> Pointed a

Change focus so it points at last element.

#atStart Source

atStart :: forall a. Pointed a -> Boolean

#atEnd Source

atEnd :: forall a. Pointed a -> Boolean