Skip to content

Instantly share code, notes, and snippets.

View muesli4's full-sized avatar
:shipit:
On secret mission...

Moritz Bruder muesli4

:shipit:
On secret mission...
  • Germany
View GitHub Profile
@muesli4
muesli4 / SeqTree.hs
Last active February 16, 2020 11:37
Data.Tree based on Data.Seq
{-# LANGUAGE DeriveFunctor #-}
module Browser.SeqTree where
import qualified Data.Sequence as S
data SeqTree a
= SeqTree
{ stLabel :: a
, stForrest :: SeqForrest a
} deriving (Read, Show, Functor)
@muesli4
muesli4 / Cell.hs
Last active February 16, 2020 11:39
Formatting cells
class Cell a where
-- | Drop a number of characters from the left side. Treats negative numbers
-- as zero.
dropLeft :: Int -> a -> a
-- | Drop a number of characters from the right side. Treats negative
-- numbers as zero.
dropRight :: Int -> a -> a
-- | Drop characters from both sides. Treats negative numbers as zero.