{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} module PrefixRead where import GHC.Generics import ADTs class PrefixRead a where prefixReads :: [String] -> Maybe ([String], a) -- default prefixReads :: (Generic a, GPrefixShow (Rep a)) -- => [String] -> Maybe ([String], a) -- prefixReads = fmap to gprefixReads