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:
{-# LANGUAGE RecordWildCards, FlexibleContexts #-} | |
-- The Computer Language Benchmarks Game | |
-- https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ | |
-- | |
-- Contributed by cahu ette | |
module Main where |