Skip to content

Instantly share code, notes, and snippets.

View swamp-agr's full-sized avatar
🎯
Looking forward

Andrey Prokopenko swamp-agr

🎯
Looking forward
View GitHub Profile
{-# LANGUAGE RecordWildCards, FlexibleContexts #-}
-- The Computer Language Benchmarks Game
-- https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
--
-- Contributed by cahu ette
module Main where
@maksbotan
maksbotan / generic-validation.md
Last active July 5, 2020 20:34
Generic validation of nested data

Generic validation of nested data

TLDR

This technique helps validate arbitrary conditions in deeply nested structures without writing additional code — with the help of Haskell Generics.

It boils down to this pattern: