Skip to content

Instantly share code, notes, and snippets.

View iostat's full-sized avatar
🕰️
time-travelling at a rate of 1 second per second

Ilya Ostrovskiy iostat

🕰️
time-travelling at a rate of 1 second per second
View GitHub Profile
@CMCDragonkai
CMCDragonkai / snoclist.hs
Last active August 3, 2023 16:47
Haskell: SnocList - just a list with its head up its ass
{-# TypeOperators #-}
data SnocList a = Lin | SnocList a :> a
listToSnocList :: [a] -> SnocList a
listToSnocList [] = Lin
listToSnocList (x : xs) = listToSnocList xs :> x
snocListToList :: SnocList a -> [a]
snocListToList Lin = []