Skip to content

Instantly share code, notes, and snippets.

View lotz84's full-sized avatar

Tatsuya Hirose lotz84

View GitHub Profile
@minoki
minoki / Sing.hs
Last active December 10, 2020 04:24
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeOperators, NoStarIsType #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-}
{-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-}
module Sing where
import qualified Data.Singletons.Prelude as S
@graninas
graninas / haskeller_competency_matrix.md
Last active April 25, 2024 20:48
Haskeller competency matrix

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Engineering in Haskell](https://github.com/graninas/software-design-in-haskell#B

Some thoughts on building software

Lately I have been busy reading some new books on Domain Driven Design (DDD) and software architecture -- including a short yet eye-opening one in Python and a great one in F#. At the same time, it seems that more people in the Functional Programming world are looking at more formal approaches to modelling -- some examples here. This has brought some thought from the background of my brain about how we should model, organize, and architect software using the lessons we've learnt from functional programming.

Before moving on, let me be clear about this being just a dump of some thoughts, not always well-defined, definite

@ChrisPenner
ChrisPenner / Optics Cheatsheet.md
Last active April 12, 2024 14:24
Optics Cheatsheet
@i-am-tom
i-am-tom / FizzBuzz.hs
Last active June 26, 2023 16:35
Arguably the fastest implementation of FizzBuzz ever written.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UnsaturatedTypeFamilies #-}
import GHC.TypeLits
import Prelude hiding (Functor, Semigroup)
type Main = (Fizz <> Buzz) <$> (0 `To` 100)
module NumberPlate where
import Data.List
data Cell = Cell {num :: Int, row :: Int, col :: Int, block :: Int} deriving Eq
data Tree = Node Board [Tree] deriving Show
type Board = [Cell]
type Ploblem = [Int]
instance Show Cell where
@Icelandjack
Icelandjack / Kleisli_Category.hs
Last active January 6, 2019 11:20
Kind-indexed Category instance for Kleisli
-- https://www.reddit.com/r/haskell/comments/abxem5/experimenting_with_kleisli_instance_of/
{-# Language TypeApplications #-}
{-# Language RankNTypes #-}
{-# Language DataKinds #-}
{-# Language KindSignatures #-}
{-# Language PolyKinds #-}
{-# Language TypeOperators #-}
{-# Language GADTs #-}
{-# Language TypeFamilies #-}
@Icelandjack
Icelandjack / Yoneda_II.markdown
Last active April 8, 2024 11:08
Yoneda Intuition from Humble Beginnings

(previous Yoneda blog) (reddit) (twitter)

Yoneda Intuition from Humble Beginnings

Let's explore the Yoneda lemma. You don't need to be an advanced Haskeller to understand this. In fact I claim you will understand the first section fine if you're comfortable with map/fmap and id.

I am not out to motivate it, but we will explore Yoneda at the level of terms and at the level of types.

@Icelandjack
Icelandjack / Yoneda.markdown
Last active February 10, 2023 00:06
Yoneda
import Data.Functor.Yoneda
import Data.Char
import Data.Kind

infixr 5
  ·

type  List :: (Type -> Type) -> Constraint
class List f where
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.