Skip to content

Instantly share code, notes, and snippets.

View Lazersmoke's full-sized avatar

Sam Quinn Lazersmoke

View GitHub Profile
@Lazersmoke
Lazersmoke / accessors.hs
Created May 30, 2016 21:05
This is my off-the-top-off-my-head lightweight lens alternative
-- Data decls could be in their own module for qualified import?
-- Alternatively, there might be a solution in GHC 8's duplicate record fields...
-- Only thing to update to add fields is the accessor functions
-- Test with an int and a str
data Test = MkTest Integer String deriving (Eq,Show)
number :: Access Integer Test
number f (MkTest n s) = (f n, MkTest (f n) s)
@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.