Skip to content

Instantly share code, notes, and snippets.

@maxigit
maxigit / reddit-response.lhs
Created August 7, 2017 22:24
Metamorphosis example
This is literate haskell file, so let start with the boring bits
>{-# LANGUAGE TemplateHaskell #-}
>{-# LANGUAGE DuplicateRecordFields #-}
>{-# LANGUAGE StandaloneDeriving,FlexibleInstances, FlexibleContexts #-}
Metamorphosis is meant to be imported unqualified, and uses lenses to configurate default records.
I'll use micro lens.
>import Metamorphosis
@maxigit
maxigit / UpdateSection.hs
Created September 3, 2023 11:34
Beautiful Functional Programming
module Fun where
import Data.List(groupBy)
data Lesson c = Lesson
{ name :: String,
lposition :: c
}
deriving (Show)
data Section c = Section