diff --git a/CONTRIBUTORS b/CONTRIBUTORS
new file mode 100644
--- /dev/null
+++ b/CONTRIBUTORS
@@ -0,0 +1,33 @@
+Tony Morris
+tmorris@tmorris.net
+http://tmorris.net/
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+mQGiBETNyC0RBAC3MYSZSbDZhBLKra2YUphB9OO6+qMFl/v2Lq8590ZfeE2WjIOu
+c/KGKyOigXztMrA4+iekUjM4FA8E6AlBRQiAqZK8HF0ftX5hDpuSyEKkZe3jcxxI
+BbhwX/SWHtDEVzwNmvO1wEnwhRE1oY/BCmy+bQ9wmAjlNav4UbOIcXcJUwCgz6FF
+UwDvPxzybgd9FNS14BE37n8D/AzGmGjunBW/x+g/ndwu6WEpTEn1ZNdja6VrNXSG
+xQ8XM+NBulroAIYX+YWdHsKnuGvSKCgVoc1ifVHdztA9sksID5GBGzhmVbIP2E16
+w/LEzqqwruv9dX0Y1b7n8hcnvbl4DgEgLgeQ+VgJfLUkY2jFZ2m3dEBRH9USSgB/
+V2pBBACP4Us2ZBYEXtMG29g6GqyeeJLEP34PLYVHWJZbet/wPQsHFhYahhzjwZGG
+Srp0JUpegJOdaqX/Y0nio2whgCpqJcrbGuUBqNgQI3k4gvBwnPyx7jM0kfHfFORG
+lq9SDbfLpV0EJx6fWXGStW33zsQQvenDcV2F5czzKQcy66BFwbQhVG9ueSBNb3Jy
+aXMgPHRtb3JyaXNAdG1vcnJpcy5uZXQ+iGMEExECACMFAkTNyC0FCQlmAYAGCwkI
+BwMCBBUCCAMEFgIDAQIeAQIXgAAKCRCaemCth7qvrf0pAKCFii2pI2W1BKVFuQcw
+yoNxP0CAUACgyhuI9isCvtrOkeyjDmCVueRCdaC5Ag0ERM3IThAIAJ6A1z+d40ve
+WvPIhpFiGfoS8UX4YdgYpo2mC/orY0xszBitogtaTHQHU5YDemGg81plNg9I3DbM
+Er8uyONV4DqF6RbLj4w+iA6zn93+PTEZ73ydhxF6vDuojpVZPXVzXzpgyXHkEVLC
+3hKL9oVlEsh+DWCvCiSAIy780JZ3FNVuMC3VH4qKxTw0CwPuuZvVfnMoIRfpODRR
+fVEk2VDor+lr8kqJkBaHgN5o/AvOXC7QCYadwbEkpr0ecxIZ1VcASYytIIM3YNL7
+ZcHWwU5PCNLOdMXPqOdthhDhsHkKJNEXXr0YsjX/bQqYOUqYKPDyqh/yrrRO9Ro6
+7eTSbfIguycAAwcH/2waLIQR8qYKxPknNuSdsOOqF2jf2gglL/7uMsIzjfkFzgHo
++GNHw9tmlZqD3yzaZ/N7Yv08ujRHhmWPBYAWRICBM3qo0zMJ9kI5XWRobeRQpLtf
+YxxIOenq8R9t6YU9ryHdqf+P+Fi38eN5ERTDhNLrJOnO5/TA+of97BWCmdtJMlWM
+RaHtqXxwo02Yi65IqKx6L7oOvT7Gh4NV2eglz8ZafPEoP8+V8ER7rwBYPiLk4Mse
+oVImjveq2dmLUip9OPwznoaeyC8zB0mJ13m/KNC+CffkBgoXpMPiKzbu5YTjVw++
+MlEmfgL42yDK0hnokmW2i9y1RBh/T1VQQeQbUaeITAQYEQIADAUCRM3ITgUJCWYB
+gAAKCRCaemCth7qvrcbtAJ9j3C6lKNRB3uKcrfze66jAVQh0qACaAysOK82TcQ/2
+73ryR0xWMFnpGqg=
+=bMTb
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/LICENCE b/LICENCE
new file mode 100644
--- /dev/null
+++ b/LICENCE
@@ -0,0 +1,32 @@
+Copyright (C) 2010-2016 NICTA Limited
+Copyright (c) 2017-2018, Commonwealth Scientific and Industrial Research Organisation
+(CSIRO) ABN 41 687 119 230.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of QFPL nor the names of other
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
--- a/LICENSE
+++ /dev/null
@@ -1,77 +0,0 @@
-CSIRO Open Source Software License Agreement (variation of the BSD / MIT
-License)
-
-Copyright (c) 2016, Commonwealth Scientific and Industrial Research Organisation
-(CSIRO) ABN 41 687 119 230.
-
-All rights reserved. CSIRO is willing to grant you a license to this
-aemo-webservice on the following terms, except where otherwise indicated for
-third party material.
-
-Redistribution and use of this software in source and binary forms, with or
-without modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice, this
-  list of conditions and the following disclaimer in the documentation and/or
-  other materials provided with the distribution.
-
-* Neither the name of CSIRO nor the names of its contributors may be used to
-  endorse or promote products derived from this software without specific prior
-  written permission of CSIRO.
-
-EXCEPT AS EXPRESSLY STATED IN THIS AGREEMENT AND TO THE FULL EXTENT PERMITTED BY
-APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS". CSIRO MAKES NO
-REPRESENTATIONS, WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS
-REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE,
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, THE ABSENCE
-OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
-DISCOVERABLE.
-
-TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL CSIRO BE
-LIABLE ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION FOR
-BREACH OF CONTRACT, NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR
-OTHER LIABILITY HOWSOEVER INCURRED.  WITHOUT LIMITING THE SCOPE OF THE PREVIOUS
-SENTENCE THE EXCLUSION OF LIABILITY SHALL INCLUDE: LOSS OF PRODUCTION OR
-OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS OF
-ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR OTHER ECONOMIC
-LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
-DAMAGES, ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT, ACCESS OF THE
-SOFTWARE OR ANY OTHER DEALINGS WITH THE SOFTWARE, EVEN IF CSIRO HAS BEEN ADVISED
-OF THE POSSIBILITY OF SUCH CLAIM, LOSS, DAMAGES OR OTHER LIABILITY.
-
-APPLICABLE LEGISLATION SUCH AS THE AUSTRALIAN CONSUMER LAW MAY APPLY
-REPRESENTATIONS, WARRANTIES, OR CONDITIONS, OR IMPOSES OBLIGATIONS OR LIABILITY
-ON CSIRO THAT CANNOT BE EXCLUDED, RESTRICTED OR MODIFIED TO THE FULL EXTENT SET
-OUT IN THE EXPRESS TERMS OF THIS CLAUSE ABOVE "CONSUMER GUARANTEES".  TO THE
-EXTENT THAT SUCH CONSUMER GUARANTEES CONTINUE TO APPLY, THEN TO THE FULL EXTENT
-PERMITTED BY THE APPLICABLE LEGISLATION, THE LIABILITY OF CSIRO UNDER THE
-RELEVANT CONSUMER GUARANTEE IS LIMITED (WHERE PERMITTED AT CSIRO'S OPTION) TO
-ONE OF FOLLOWING REMEDIES OR SUBSTANTIALLY EQUIVALENT REMEDIES:
-
-(a)               THE REPLACEMENT OF THE SOFTWARE, THE SUPPLY OF EQUIVALENT
-                  SOFTWARE, OR SUPPLYING RELEVANT SERVICES AGAIN;
-(b)               THE REPAIR OF THE SOFTWARE;
-(c)               THE PAYMENT OF THE COST OF REPLACING THE
-                  SOFTWARE, OF ACQUIRING EQUIVALENT SOFTWARE, HAVING THE
-                  RELEVANT SERVICES SUPPLIED AGAIN, OR HAVING THE SOFTWARE
-                  REPAIRED.
-
-IN THIS CLAUSE, CSIRO INCLUDES ANY THIRD PARTY AUTHOR OR OWNER OF ANY PART OF
-THE SOFTWARE OR MATERIAL DISTRIBUTED WITH IT.  CSIRO MAY ENFORCE ANY RIGHTS ON
-BEHALF OF THE RELEVANT THIRD PARTY.
-
-Third Party Components
-
-The following third party components are distributed with the Software.  You
-agree to comply with the license terms for these components as part of accessing
-the Software.  Other third party software may also be identified in separate
-files distributed with the Software.
-
-___________________________________________________________________
-
-___________________________________________________________________
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/Setup.lhs b/Setup.lhs
deleted file mode 100644
--- a/Setup.lhs
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env runhaskell
-\begin{code}
-{-# OPTIONS_GHC -Wall #-}
-module Main (main) where
-
-import Data.List ( nub )
-import Data.Version ( showVersion )
-import Distribution.Package ( PackageName(PackageName), PackageId, InstalledPackageId, packageVersion, packageName )
-import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) )
-import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks )
-import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose )
-import Distribution.Simple.BuildPaths ( autogenModulesDir )
-import Distribution.Simple.Setup ( BuildFlags(buildVerbosity), fromFlag )
-import Distribution.Simple.LocalBuildInfo ( withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps) )
-import Distribution.Verbosity ( Verbosity )
-import System.FilePath ( (</>) )
-
-main :: IO ()
-main = defaultMainWithHooks simpleUserHooks
-  { buildHook = \pkg lbi hooks flags -> do
-     generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi
-     buildHook simpleUserHooks pkg lbi hooks flags
-  }
-
-generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
-generateBuildModule verbosity pkg lbi = do
-  let dir = autogenModulesDir lbi
-  createDirectoryIfMissingVerbose verbosity True dir
-  withLibLBI pkg lbi $ \_ libcfg -> do
-    withTestLBI pkg lbi $ \suite suitecfg -> do
-      rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines
-        [ "module Build_" ++ testName suite ++ " where"
-        , "deps :: [String]"
-        , "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg))
-        ]
-  where
-    formatdeps = map (formatone . snd)
-    formatone p = case packageName p of
-      PackageName n -> n ++ "-" ++ showVersion (packageVersion p)
-
-testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)]
-testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys
-
-\end{code}
diff --git a/alphachar.cabal b/alphachar.cabal
--- a/alphachar.cabal
+++ b/alphachar.cabal
@@ -1,35 +1,38 @@
 name:               alphachar
-version:            0.0.1
+version:            0.0.2
 license:            BSD3
-license-file:       LICENSE
-author:             Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
-maintainer:         Tony Morris
-copyright:          Copyright (c) 2016, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230.
+license-file:       LICENCE
+author:             Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
+maintainer:         Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
+copyright:          Copyright (C) 2010-2016 NICTA Limited
+                    Copyright (c) 2017-2018, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230.
 synopsis:           A character between a-z
-category:           Prelude
-description:        A character between a-z
-homepage:           https://github.com/data61/alphachar
-bug-reports:        https://github.com/data61/alphachar/issues
+category:           Data
+homepage:           https://github.com/qfpl/alphachar
+bug-reports:        https://github.com/qfpl/alphachar/issues
 cabal-version:      >= 1.10
-build-type:         Custom
-extra-source-files: changelog
+build-type:         Simple
+extra-source-files: CONTRIBUTORS, changelog.md
+tested-with:        GHC == 8.4.1, GHC == 8.2.2, GHC == 8.0.2, GHC == 7.10.3
+description:
+  <<http://i.imgur.com/uZnp9ke.png>>
+  .
+  A character between a-z
 
 source-repository   head
   type:             git
-  location:         git@github.com:data61/alphachar.git
-
-flag                small_base
-  description:      Choose the new, split-up base package.
+  location:         git@github.com:qfpl/alphachar.git
 
 library
   default-language:
                     Haskell2010
 
   build-depends:
-                    base >= 4.8 && < 5
-                    , lens >= 4.1 && < 5
-                    , parsers >= 0.12 && < 1
-
+                    base               >= 4.7 && < 5
+                    , lens             >= 4.0 && < 5
+                    , parsers          >= 0.12.3 && < 0.13
+                    , semigroups       >= 0.12 && < 1.0
+                    
   ghc-options:
                     -Wall
 
@@ -41,29 +44,38 @@
 
   exposed-modules:
                     Data.Char.Alpha
-                    
-test-suite doctests
+
+test-suite tests
   type:
                     exitcode-stdio-1.0
 
   main-is:
-                    doctests.hs
+                    Main.hs
 
   default-language:
                     Haskell2010
 
   build-depends:
-                    base < 5 && >= 3
-                    , doctest >= 0.9.7
-                    , filepath >= 1.3
-                    , directory >= 1.1
-                    , QuickCheck >= 2.0
-                    , template-haskell >= 2.8
-                    , parsec >= 0.12 && < 1
+                    base             >=4.8    && <4.12
+                    , lens           >=4.0    && <5
+                    , ansi-wl-pprint >=0.6    && <0.7
+                    , hedgehog       >=0.5    && <0.7
+                    , tasty          >=0.11   && <1.2
+                    , tasty-hspec    >=1.1    && <1.2
+                    , parsec         >=3.1    && <3.2
+                    , parsers        >=0.12.3 && <0.13
+                    , pretty         >=1.1    && <1.2
+                    , text           >=1.2    && <1.3
+                    , tasty-hedgehog >=0.1    && <0.3
+                    , tasty-hunit    >=0.9    && <0.11
+                    , alphachar
 
   ghc-options:
                     -Wall
                     -threaded
+
+  default-extensions:
+                    NoImplicitPrelude
 
   hs-source-dirs:
                     test
diff --git a/changelog b/changelog
deleted file mode 100644
--- a/changelog
+++ /dev/null
@@ -1,4 +0,0 @@
-0.0.1
-
-* Initial release
-
diff --git a/changelog.md b/changelog.md
new file mode 100644
--- /dev/null
+++ b/changelog.md
@@ -0,0 +1,7 @@
+0.0.2
+
+* Rewrite to use `Generic`.
+
+0.0.1
+
+* Initial release
diff --git a/src/Data/Char/Alpha.hs b/src/Data/Char/Alpha.hs
--- a/src/Data/Char/Alpha.hs
+++ b/src/Data/Char/Alpha.hs
@@ -1,214 +1,3244 @@
 {-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE TemplateHaskell #-}
-{-# LANGUAGE RankNTypes #-}
-
-module Data.Char.Alpha(
--- * Upper-case
-  AlphaUpper
-, HasAlphaUpper(alphaUpper)
-, AsAlphaUpper(_AlphaUpper)
-, parseAlphaUpper
--- * Lower-case
-, AlphaLower
-, HasAlphaLower(alphaLower)
-, AsAlphaLower(_AlphaLower)
-, parseAlphaLower
--- * Any case
-, Alpha(UpperAlpha, LowerAlpha)
-, HasAlpha(alpha)
-, AsAlpha(_Alpha, _UpperAlpha, _LowerAlpha)
-, parseAlpha
--- * Accessory
-, upperlower
-, lowerupper
-) where
-
-import Control.Applicative((<$>), (<|>), empty)
-import Control.Category((.), id)
-import Control.Lens(makeClassy, makeClassyPrisms, from, iso, prism', (^?), Iso', Prism')
-import Control.Monad(Monad((>>=), return))
-import Data.Char(Char, toLower, toUpper)
-import Data.Eq(Eq)
-import Data.Foldable(elem)
-import Data.Maybe(Maybe(Just, Nothing), maybe)
-import Data.Ord(Ord)
-import Prelude(Show)
-import Text.Parser.Char(CharParsing, anyChar)
-import Text.Parser.Combinators((<?>), try)
-
--- $setup
---
--- >>> import Text.Parsec(parse)
-
--- | An upper-case character between @'A'@ and @'Z'@.
-newtype AlphaUpper =
-  AlphaUpper Char
-  deriving (Eq, Ord, Show)
-
-makeClassy ''AlphaUpper
-
-class AsAlphaUpper a where
-  _AlphaUpper ::
-    Prism'
-      a
-      AlphaUpper
-
-instance AsAlphaUpper AlphaUpper where
-  _AlphaUpper =
-    id
-
-instance AsAlphaUpper Char where
-  _AlphaUpper =
-    prism'
-      (\(AlphaUpper c) -> c)
-      (\c ->  if c `elem` ['A'..'Z']
-                then
-                  Just (AlphaUpper c)
-                else
-                  Nothing)
-
--- | Parse an upper-case alpha character.
---
--- >>> parse parseAlphaUpper "parseAlphaUpper" "A"
--- Right (AlphaUpper 'A')
---
--- >>> parse parseAlphaUpper "parseAlphaUpper" "Abc"
--- Right (AlphaUpper 'A')
---
--- >>> isn't _Right (parse parseAlphaUpper "parseAlphaUpper" "a")
--- True
---
--- >>> isn't _Right (parse parseAlphaUpper "parseAlphaUpper" "")
--- True
---
--- >>> isn't _Right (parse parseAlphaUpper "parseAlphaUpper" "0")
--- True
-parseAlphaUpper ::
-  (Monad f, CharParsing f) =>
-  f AlphaUpper
-parseAlphaUpper =
-  try (anyChar >>= \c -> maybe empty return (c ^? _AlphaUpper)) <?> "AlphaUpper"
-
--- | A lower-case character between @'a'@ and @'z'@.
-newtype AlphaLower =
-  AlphaLower Char
-  deriving (Eq, Ord, Show)
-
-makeClassy ''AlphaLower
-
-class AsAlphaLower a where
-  _AlphaLower ::
-    Prism'
-      a
-      AlphaLower
-
-instance AsAlphaLower AlphaLower where
-  _AlphaLower =
-    id
-
-instance AsAlphaLower Char where
-  _AlphaLower =
-    prism'
-      (\(AlphaLower c) -> c)
-      (\c ->  if c `elem` ['a'..'z']
-                then
-                  Just (AlphaLower c)
-                else
-                  Nothing)
-
--- | Parse a lower-case alpha character.
---
--- >>> parse parseAlphaLower "parseAlphaLower" "a"
--- Right (AlphaLower 'a')
---
--- >>> parse parseAlphaLower "parseAlphaLower" "aBC"
--- Right (AlphaLower 'a')
---
--- >>> isn't _Right (parse parseAlphaLower "parseAlphaLower" "B")
--- True
---
--- >>> isn't _Right (parse parseAlphaLower "parseAlphaLower" "")
--- True
---
--- >>> isn't _Right (parse parseAlphaLower "parseAlphaLower" "0")
--- True
-parseAlphaLower ::
-  (Monad f, CharParsing f) =>
-  f AlphaLower
-parseAlphaLower =
-  try (anyChar >>= \c -> maybe empty return (c ^? _AlphaLower)) <?> "AlphaLower"
-
--- | Either a lower-case character between @'a'@ and @'z'@ or an upper-case character between @'A'@ and @'Z'@.
-data Alpha =
-  UpperAlpha AlphaUpper
-  | LowerAlpha AlphaLower
-  deriving (Eq, Ord, Show)
-
-makeClassyPrisms ''Alpha
-makeClassy ''Alpha
-
--- | Parse an upper-case or lower-case character.
---
--- >>> parse parseAlpha "parseAlpha" "a"
--- Right (LowerAlpha (AlphaLower 'a'))
---
--- >>> parse parseAlpha "parseAlpha" "aBC"
--- Right (LowerAlpha (AlphaLower 'a'))
---
--- >>> parse parseAlpha "parseAlpha" "A"
--- Right (UpperAlpha (AlphaUpper 'A'))
---
--- >>> parse parseAlpha "parseAlpha" "Abc"
--- Right (UpperAlpha (AlphaUpper 'A'))
---
--- >>> isn't _Right (parse parseAlpha "parseAlpha" "0")
--- True
-parseAlpha ::
-  (Monad f, CharParsing f) =>
-  f Alpha
-parseAlpha =
-   UpperAlpha <$> parseAlphaUpper <|> LowerAlpha <$> parseAlphaLower
-
-instance AsAlphaLower Alpha where
-  _AlphaLower =
-    _LowerAlpha . _AlphaLower
-
-instance AsAlphaUpper Alpha where
-  _AlphaUpper =
-    _UpperAlpha . _AlphaUpper
-
--- | Isomorphism from upper to lower.
---
--- >>> (upperlower #) <$> ('a' ^? _AlphaLower)
--- Just (AlphaUpper 'A')
---
--- >>> (upperlower #) <$> ('A' ^? _AlphaLower)
--- Nothing
---
--- >>> (upperlower #) <$> ('3' ^? _AlphaLower)
--- Nothing
-upperlower ::
-  Iso'
-    AlphaUpper
-    AlphaLower
-upperlower =
-  iso
-    (\(AlphaUpper c) -> AlphaLower (toLower c))
-    (\(AlphaLower c) -> AlphaUpper (toUpper c))
-
--- | Isomorphism from lower to upper.
---
--- >>> (lowerupper #) <$> ('A' ^? _AlphaUpper)
--- Just (AlphaLower 'a')
---
--- >>> (lowerupper #) <$> ('a' ^? _AlphaUpper)
--- Nothing
---
--- >>> (lowerupper #) <$> ('3' ^? _AlphaUpper)
--- Nothing
-lowerupper ::
-  Iso'
-    AlphaLower
-    AlphaUpper
-lowerupper =
-  from upperlower
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE ConstraintKinds #-}
+
+module Data.Char.Alpha where
+
+import Control.Applicative((<|>))
+import Control.Category(id, (.))
+import Control.Lens(Prism', Iso', prism', iso, from, involuted, (^.), ( # ))
+import Data.Char(Char)
+import Data.Eq(Eq)
+import Data.Functor((<$), (<$>))
+import Data.List(lookup)
+import Data.List.NonEmpty(NonEmpty((:|)))
+import Data.Maybe(Maybe(Just, Nothing), fromMaybe)
+import Data.Ord(Ord)
+import GHC.Generics(Generic)
+import Text.Parser.Char(CharParsing, char)
+import Text.Parser.Combinators((<?>))
+import Prelude(Show)
+
+data A_a =
+  A_a
+  deriving (Eq, Ord, Show, Generic)
+
+class Ca x where
+  _a' ::
+    Prism' x ()
+  _a ::
+    x
+  _a =
+    _a' # ()
+
+instance Ca () where
+  _a' =
+    id
+
+instance Ca A_a where
+  _a' =
+    prism'
+      (\() -> A_a)
+      (\A_a -> Just ())
+
+instance Ca Char where
+  _a' =
+    prism'
+      (\() -> 'a')
+      (\c ->  case c of
+                'a' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_a ::
+  (Ca x, CharParsing p) =>
+  p x
+parse_a =
+  _a <$ char 'a' <?> "a"
+
+data B_b =
+  B_b
+  deriving (Eq, Ord, Show, Generic)
+
+class Cb x where
+  _b' ::
+    Prism' x ()
+  _b ::
+    x
+  _b =
+    _b' # ()
+
+instance Cb () where
+  _b' =
+    id
+
+instance Cb B_b where
+  _b' =
+    prism'
+      (\() -> B_b)
+      (\B_b -> Just ())
+
+instance Cb Char where
+  _b' =
+    prism'
+      (\() -> 'b')
+      (\c ->  case c of
+                'b' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_b ::
+  (Cb x, CharParsing p) =>
+  p x
+parse_b =
+  _b <$ char 'b' <?> "b"
+
+data C_c =
+  C_c
+  deriving (Eq, Ord, Show, Generic)
+
+class Cc x where
+  _c' ::
+    Prism' x ()
+  _c ::
+    x
+  _c =
+    _c' # ()
+
+instance Cc () where
+  _c' =
+    id
+
+instance Cc C_c where
+  _c' =
+    prism'
+      (\() -> C_c)
+      (\C_c -> Just ())
+
+instance Cc Char where
+  _c' =
+    prism'
+      (\() -> 'c')
+      (\c ->  case c of
+                'c' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_c ::
+  (Cc x, CharParsing p) =>
+  p x
+parse_c =
+  _c <$ char 'c' <?> "c"
+
+data D_d =
+  D_d
+  deriving (Eq, Ord, Show, Generic)
+
+class Cd x where
+  _d' ::
+    Prism' x ()
+  _d ::
+    x
+  _d =
+    _d' # ()
+
+instance Cd () where
+  _d' =
+    id
+
+instance Cd D_d where
+  _d' =
+    prism'
+      (\() -> D_d)
+      (\D_d -> Just ())
+
+instance Cd Char where
+  _d' =
+    prism'
+      (\() -> 'd')
+      (\c ->  case c of
+                'd' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_d ::
+  (Cd x, CharParsing p) =>
+  p x
+parse_d =
+  _d <$ char 'd' <?> "d"
+
+data E_e =
+  E_e
+  deriving (Eq, Ord, Show, Generic)
+
+class Ce x where
+  _e' ::
+    Prism' x ()
+  _e ::
+    x
+  _e =
+    _e' # ()
+
+instance Ce () where
+  _e' =
+    id
+
+instance Ce E_e where
+  _e' =
+    prism'
+      (\() -> E_e)
+      (\E_e -> Just ())
+
+instance Ce Char where
+  _e' =
+    prism'
+      (\() -> 'e')
+      (\c ->  case c of
+                'e' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_e ::
+  (Ce x, CharParsing p) =>
+  p x
+parse_e =
+  _e <$ char 'e' <?> "e"
+
+data F_f =
+  F_f
+  deriving (Eq, Ord, Show, Generic)
+
+class Cf x where
+  _f' ::
+    Prism' x ()
+  _f ::
+    x
+  _f =
+    _f' # ()
+
+instance Cf () where
+  _f' =
+    id
+
+instance Cf F_f where
+  _f' =
+    prism'
+      (\() -> F_f)
+      (\F_f -> Just ())
+
+instance Cf Char where
+  _f' =
+    prism'
+      (\() -> 'f')
+      (\c ->  case c of
+                'f' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_f ::
+  (Cf x, CharParsing p) =>
+  p x
+parse_f =
+  _f <$ char 'f' <?> "f"
+
+data G_g =
+  G_g
+  deriving (Eq, Ord, Show, Generic)
+
+class Cg x where
+  _g' ::
+    Prism' x ()
+  _g ::
+    x
+  _g =
+    _g' # ()
+
+instance Cg () where
+  _g' =
+    id
+
+instance Cg G_g where
+  _g' =
+    prism'
+      (\() -> G_g)
+      (\G_g -> Just ())
+
+instance Cg Char where
+  _g' =
+    prism'
+      (\() -> 'g')
+      (\c ->  case c of
+                'g' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_g ::
+  (Cg x, CharParsing p) =>
+  p x
+parse_g =
+  _g <$ char 'g' <?> "g"
+
+data H_h =
+  H_h
+  deriving (Eq, Ord, Show, Generic)
+
+class Ch x where
+  _h' ::
+    Prism' x ()
+  _h ::
+    x
+  _h =
+    _h' # ()
+
+instance Ch () where
+  _h' =
+    id
+
+instance Ch H_h where
+  _h' =
+    prism'
+      (\() -> H_h)
+      (\H_h -> Just ())
+
+instance Ch Char where
+  _h' =
+    prism'
+      (\() -> 'h')
+      (\c ->  case c of
+                'h' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_h ::
+  (Ch x, CharParsing p) =>
+  p x
+parse_h =
+  _h <$ char 'h' <?> "h"
+
+data I_i =
+  I_i
+  deriving (Eq, Ord, Show, Generic)
+
+class Ci x where
+  _i' ::
+    Prism' x ()
+  _i ::
+    x
+  _i =
+    _i' # ()
+
+instance Ci () where
+  _i' =
+    id
+
+instance Ci I_i where
+  _i' =
+    prism'
+      (\() -> I_i)
+      (\I_i -> Just ())
+
+instance Ci Char where
+  _i' =
+    prism'
+      (\() -> 'i')
+      (\c ->  case c of
+                'i' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_i ::
+  (Ci x, CharParsing p) =>
+  p x
+parse_i =
+  _i <$ char 'i' <?> "i"
+
+data J_j =
+  J_j
+  deriving (Eq, Ord, Show, Generic)
+
+class Cj x where
+  _j' ::
+    Prism' x ()
+  _j ::
+    x
+  _j =
+    _j' # ()
+
+instance Cj () where
+  _j' =
+    id
+
+instance Cj J_j where
+  _j' =
+    prism'
+      (\() -> J_j)
+      (\J_j -> Just ())
+
+instance Cj Char where
+  _j' =
+    prism'
+      (\() -> 'j')
+      (\c ->  case c of
+                'j' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_j ::
+  (Cj x, CharParsing p) =>
+  p x
+parse_j =
+  _j <$ char 'j' <?> "j"
+
+data K_k =
+  K_k
+  deriving (Eq, Ord, Show, Generic)
+
+class Ck x where
+  _k' ::
+    Prism' x ()
+  _k ::
+    x
+  _k =
+    _k' # ()
+
+instance Ck () where
+  _k' =
+    id
+
+instance Ck K_k where
+  _k' =
+    prism'
+      (\() -> K_k)
+      (\K_k -> Just ())
+
+instance Ck Char where
+  _k' =
+    prism'
+      (\() -> 'k')
+      (\c ->  case c of
+                'k' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_k ::
+  (Ck x, CharParsing p) =>
+  p x
+parse_k =
+  _k <$ char 'k' <?> "k"
+
+data L_l =
+  L_l
+  deriving (Eq, Ord, Show, Generic)
+
+class Cl x where
+  _l' ::
+    Prism' x ()
+  _l ::
+    x
+  _l =
+    _l' # ()
+
+instance Cl () where
+  _l' =
+    id
+
+instance Cl L_l where
+  _l' =
+    prism'
+      (\() -> L_l)
+      (\L_l -> Just ())
+
+instance Cl Char where
+  _l' =
+    prism'
+      (\() -> 'l')
+      (\c ->  case c of
+                'l' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_l ::
+  (Cl x, CharParsing p) =>
+  p x
+parse_l =
+  _l <$ char 'l' <?> "l"
+
+data M_m =
+  M_m
+  deriving (Eq, Ord, Show, Generic)
+
+class Cm x where
+  _m' ::
+    Prism' x ()
+  _m ::
+    x
+  _m =
+    _m' # ()
+
+instance Cm () where
+  _m' =
+    id
+
+instance Cm M_m where
+  _m' =
+    prism'
+      (\() -> M_m)
+      (\M_m -> Just ())
+
+instance Cm Char where
+  _m' =
+    prism'
+      (\() -> 'm')
+      (\c ->  case c of
+                'm' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_m ::
+  (Cm x, CharParsing p) =>
+  p x
+parse_m =
+  _m <$ char 'm' <?> "m"
+
+data N_n =
+  N_n
+  deriving (Eq, Ord, Show, Generic)
+
+class Cn x where
+  _n' ::
+    Prism' x ()
+  _n ::
+    x
+  _n =
+    _n' # ()
+
+instance Cn () where
+  _n' =
+    id
+
+instance Cn N_n where
+  _n' =
+    prism'
+      (\() -> N_n)
+      (\N_n -> Just ())
+
+instance Cn Char where
+  _n' =
+    prism'
+      (\() -> 'n')
+      (\c ->  case c of
+                'n' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_n ::
+  (Cn x, CharParsing p) =>
+  p x
+parse_n =
+  _n <$ char 'n' <?> "n"
+
+data O_o =
+  O_o
+  deriving (Eq, Ord, Show, Generic)
+
+class Co x where
+  _o' ::
+    Prism' x ()
+  _o ::
+    x
+  _o =
+    _o' # ()
+
+instance Co () where
+  _o' =
+    id
+
+instance Co O_o where
+  _o' =
+    prism'
+      (\() -> O_o)
+      (\O_o -> Just ())
+
+instance Co Char where
+  _o' =
+    prism'
+      (\() -> 'o')
+      (\c ->  case c of
+                'o' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_o ::
+  (Co x, CharParsing p) =>
+  p x
+parse_o =
+  _o <$ char 'o' <?> "o"
+
+data P_p =
+  P_p
+  deriving (Eq, Ord, Show, Generic)
+
+class Cp x where
+  _p' ::
+    Prism' x ()
+  _p ::
+    x
+  _p =
+    _p' # ()
+
+instance Cp () where
+  _p' =
+    id
+
+instance Cp P_p where
+  _p' =
+    prism'
+      (\() -> P_p)
+      (\P_p -> Just ())
+
+instance Cp Char where
+  _p' =
+    prism'
+      (\() -> 'p')
+      (\c ->  case c of
+                'p' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_p ::
+  (Cp x, CharParsing p) =>
+  p x
+parse_p =
+  _p <$ char 'p' <?> "p"
+
+data Q_q =
+  Q_q
+  deriving (Eq, Ord, Show, Generic)
+
+class Cq x where
+  _q' ::
+    Prism' x ()
+  _q ::
+    x
+  _q =
+    _q' # ()
+
+instance Cq () where
+  _q' =
+    id
+
+instance Cq Q_q where
+  _q' =
+    prism'
+      (\() -> Q_q)
+      (\Q_q -> Just ())
+
+instance Cq Char where
+  _q' =
+    prism'
+      (\() -> 'q')
+      (\c ->  case c of
+                'q' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_q ::
+  (Cq x, CharParsing p) =>
+  p x
+parse_q =
+  _q <$ char 'q' <?> "q"
+
+data R_r =
+  R_r
+  deriving (Eq, Ord, Show, Generic)
+
+class Cr x where
+  _r' ::
+    Prism' x ()
+  _r ::
+    x
+  _r =
+    _r' # ()
+
+instance Cr () where
+  _r' =
+    id
+
+instance Cr R_r where
+  _r' =
+    prism'
+      (\() -> R_r)
+      (\R_r -> Just ())
+
+instance Cr Char where
+  _r' =
+    prism'
+      (\() -> 'r')
+      (\c ->  case c of
+                'r' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_r ::
+  (Cr x, CharParsing p) =>
+  p x
+parse_r =
+  _r <$ char 'r' <?> "r"
+
+data S_s =
+  S_s
+  deriving (Eq, Ord, Show, Generic)
+
+class Cs x where
+  _s' ::
+    Prism' x ()
+  _s ::
+    x
+  _s =
+    _s' # ()
+
+instance Cs () where
+  _s' =
+    id
+
+instance Cs S_s where
+  _s' =
+    prism'
+      (\() -> S_s)
+      (\S_s -> Just ())
+
+instance Cs Char where
+  _s' =
+    prism'
+      (\() -> 's')
+      (\c ->  case c of
+                's' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_s ::
+  (Cs x, CharParsing p) =>
+  p x
+parse_s =
+  _s <$ char 's' <?> "s"
+
+data T_t =
+  T_t
+  deriving (Eq, Ord, Show, Generic)
+
+class Ct x where
+  _t' ::
+    Prism' x ()
+  _t ::
+    x
+  _t =
+    _t' # ()
+
+instance Ct () where
+  _t' =
+    id
+
+instance Ct T_t where
+  _t' =
+    prism'
+      (\() -> T_t)
+      (\T_t -> Just ())
+
+instance Ct Char where
+  _t' =
+    prism'
+      (\() -> 't')
+      (\c ->  case c of
+                't' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_t ::
+  (Ct x, CharParsing p) =>
+  p x
+parse_t =
+  _t <$ char 't' <?> "t"
+
+data U_u =
+  U_u
+  deriving (Eq, Ord, Show, Generic)
+
+class Cu x where
+  _u' ::
+    Prism' x ()
+  _u ::
+    x
+  _u =
+    _u' # ()
+
+instance Cu () where
+  _u' =
+    id
+
+instance Cu U_u where
+  _u' =
+    prism'
+      (\() -> U_u)
+      (\U_u -> Just ())
+
+instance Cu Char where
+  _u' =
+    prism'
+      (\() -> 'u')
+      (\c ->  case c of
+                'u' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_u ::
+  (Cu x, CharParsing p) =>
+  p x
+parse_u =
+  _u <$ char 'u' <?> "u"
+
+data V_v =
+  V_v
+  deriving (Eq, Ord, Show, Generic)
+
+class Cv x where
+  _v' ::
+    Prism' x ()
+  _v ::
+    x
+  _v =
+    _v' # ()
+
+instance Cv () where
+  _v' =
+    id
+
+instance Cv V_v where
+  _v' =
+    prism'
+      (\() -> V_v)
+      (\V_v -> Just ())
+
+instance Cv Char where
+  _v' =
+    prism'
+      (\() -> 'v')
+      (\c ->  case c of
+                'v' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_v ::
+  (Cv x, CharParsing p) =>
+  p x
+parse_v =
+  _v <$ char 'v' <?> "v"
+
+data W_w =
+  W_w
+  deriving (Eq, Ord, Show, Generic)
+
+class Cw x where
+  _w' ::
+    Prism' x ()
+  _w ::
+    x
+  _w =
+    _w' # ()
+
+instance Cw () where
+  _w' =
+    id
+
+instance Cw W_w where
+  _w' =
+    prism'
+      (\() -> W_w)
+      (\W_w -> Just ())
+
+instance Cw Char where
+  _w' =
+    prism'
+      (\() -> 'w')
+      (\c ->  case c of
+                'w' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_w ::
+  (Cw x, CharParsing p) =>
+  p x
+parse_w =
+  _w <$ char 'w' <?> "w"
+
+data X_x =
+  X_x
+  deriving (Eq, Ord, Show, Generic)
+
+class Cx x where
+  _x' ::
+    Prism' x ()
+  _x ::
+    x
+  _x =
+    _x' # ()
+
+instance Cx () where
+  _x' =
+    id
+
+instance Cx X_x where
+  _x' =
+    prism'
+      (\() -> X_x)
+      (\X_x -> Just ())
+
+instance Cx Char where
+  _x' =
+    prism'
+      (\() -> 'x')
+      (\c ->  case c of
+                'x' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_x ::
+  (Cx x, CharParsing p) =>
+  p x
+parse_x =
+  _x <$ char 'x' <?> "x"
+
+data Y_y =
+  Y_y
+  deriving (Eq, Ord, Show, Generic)
+
+class Cy x where
+  _y' ::
+    Prism' x ()
+  _y ::
+    x
+  _y =
+    _y' # ()
+
+instance Cy () where
+  _y' =
+    id
+
+instance Cy Y_y where
+  _y' =
+    prism'
+      (\() -> Y_y)
+      (\Y_y -> Just ())
+
+instance Cy Char where
+  _y' =
+    prism'
+      (\() -> 'y')
+      (\c ->  case c of
+                'y' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_y ::
+  (Cy x, CharParsing p) =>
+  p x
+parse_y =
+  _y <$ char 'y' <?> "y"
+
+data Z_z =
+  Z_z
+  deriving (Eq, Ord, Show, Generic)
+
+class Cz x where
+  _z' ::
+    Prism' x ()
+  _z ::
+    x
+  _z =
+    _z' # ()
+
+instance Cz () where
+  _z' =
+    id
+
+instance Cz Z_z where
+  _z' =
+    prism'
+      (\() -> Z_z)
+      (\Z_z -> Just ())
+
+instance Cz Char where
+  _z' =
+    prism'
+      (\() -> 'z')
+      (\c ->  case c of
+                'z' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_z ::
+  (Cz x, CharParsing p) =>
+  p x
+parse_z =
+  _z <$ char 'z' <?> "z"
+
+data A_A =
+  A_A
+  deriving (Eq, Ord, Show, Generic)
+
+class CA x where
+  _A' ::
+    Prism' x ()
+  _A ::
+    x
+  _A =
+    _A' # ()
+
+instance CA () where
+  _A' =
+    id
+
+instance CA A_A where
+  _A' =
+    prism'
+      (\() -> A_A)
+      (\A_A -> Just ())
+
+instance CA Char where
+  _A' =
+    prism'
+      (\() -> 'A')
+      (\c ->  case c of
+                'A' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_A ::
+  (CA x, CharParsing p) =>
+  p x
+parse_A =
+  _A <$ char 'A' <?> "A"
+
+data B_B =
+  B_B
+  deriving (Eq, Ord, Show, Generic)
+
+class CB x where
+  _B' ::
+    Prism' x ()
+  _B ::
+    x
+  _B =
+    _B' # ()
+
+instance CB () where
+  _B' =
+    id
+
+instance CB B_B where
+  _B' =
+    prism'
+      (\() -> B_B)
+      (\B_B -> Just ())
+
+instance CB Char where
+  _B' =
+    prism'
+      (\() -> 'B')
+      (\c ->  case c of
+                'B' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_B ::
+  (CB x, CharParsing p) =>
+  p x
+parse_B =
+  _B <$ char 'B' <?> "B"
+
+data C_C =
+  C_C
+  deriving (Eq, Ord, Show, Generic)
+
+class CC x where
+  _C' ::
+    Prism' x ()
+  _C ::
+    x
+  _C =
+    _C' # ()
+
+instance CC () where
+  _C' =
+    id
+
+instance CC C_C where
+  _C' =
+    prism'
+      (\() -> C_C)
+      (\C_C -> Just ())
+
+instance CC Char where
+  _C' =
+    prism'
+      (\() -> 'C')
+      (\c ->  case c of
+                'C' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_C ::
+  (CC x, CharParsing p) =>
+  p x
+parse_C =
+  _C <$ char 'C' <?> "C"
+
+data D_D =
+  D_D
+  deriving (Eq, Ord, Show, Generic)
+
+class CD x where
+  _D' ::
+    Prism' x ()
+  _D ::
+    x
+  _D =
+    _D' # ()
+
+instance CD () where
+  _D' =
+    id
+
+instance CD D_D where
+  _D' =
+    prism'
+      (\() -> D_D)
+      (\D_D -> Just ())
+
+instance CD Char where
+  _D' =
+    prism'
+      (\() -> 'D')
+      (\c ->  case c of
+                'D' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_D ::
+  (CD x, CharParsing p) =>
+  p x
+parse_D =
+  _D <$ char 'D' <?> "D"
+
+data E_E =
+  E_E
+  deriving (Eq, Ord, Show, Generic)
+
+class CE x where
+  _E' ::
+    Prism' x ()
+  _E ::
+    x
+  _E =
+    _E' # ()
+
+instance CE () where
+  _E' =
+    id
+
+instance CE E_E where
+  _E' =
+    prism'
+      (\() -> E_E)
+      (\E_E -> Just ())
+
+instance CE Char where
+  _E' =
+    prism'
+      (\() -> 'E')
+      (\c ->  case c of
+                'E' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_E ::
+  (CE x, CharParsing p) =>
+  p x
+parse_E =
+  _E <$ char 'E' <?> "E"
+
+data F_F =
+  F_F
+  deriving (Eq, Ord, Show, Generic)
+
+class CF x where
+  _F' ::
+    Prism' x ()
+  _F ::
+    x
+  _F =
+    _F' # ()
+
+instance CF () where
+  _F' =
+    id
+
+instance CF F_F where
+  _F' =
+    prism'
+      (\() -> F_F)
+      (\F_F -> Just ())
+
+instance CF Char where
+  _F' =
+    prism'
+      (\() -> 'F')
+      (\c ->  case c of
+                'F' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_F ::
+  (CF x, CharParsing p) =>
+  p x
+parse_F =
+  _F <$ char 'F' <?> "F"
+
+data G_G =
+  G_G
+  deriving (Eq, Ord, Show, Generic)
+
+class CG x where
+  _G' ::
+    Prism' x ()
+  _G ::
+    x
+  _G =
+    _G' # ()
+
+instance CG () where
+  _G' =
+    id
+
+instance CG G_G where
+  _G' =
+    prism'
+      (\() -> G_G)
+      (\G_G -> Just ())
+
+instance CG Char where
+  _G' =
+    prism'
+      (\() -> 'G')
+      (\c ->  case c of
+                'G' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_G ::
+  (CG x, CharParsing p) =>
+  p x
+parse_G =
+  _G <$ char 'G' <?> "G"
+
+data H_H =
+  H_H
+  deriving (Eq, Ord, Show, Generic)
+
+class CH x where
+  _H' ::
+    Prism' x ()
+  _H ::
+    x
+  _H =
+    _H' # ()
+
+instance CH () where
+  _H' =
+    id
+
+instance CH H_H where
+  _H' =
+    prism'
+      (\() -> H_H)
+      (\H_H -> Just ())
+
+instance CH Char where
+  _H' =
+    prism'
+      (\() -> 'H')
+      (\c ->  case c of
+                'H' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_H ::
+  (CH x, CharParsing p) =>
+  p x
+parse_H =
+  _H <$ char 'H' <?> "H"
+
+data I_I =
+  I_I
+  deriving (Eq, Ord, Show, Generic)
+
+class CI x where
+  _I' ::
+    Prism' x ()
+  _I ::
+    x
+  _I =
+    _I' # ()
+
+instance CI () where
+  _I' =
+    id
+
+instance CI I_I where
+  _I' =
+    prism'
+      (\() -> I_I)
+      (\I_I -> Just ())
+
+instance CI Char where
+  _I' =
+    prism'
+      (\() -> 'I')
+      (\c ->  case c of
+                'I' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_I ::
+  (CI x, CharParsing p) =>
+  p x
+parse_I =
+  _I <$ char 'I' <?> "I"
+
+data J_J =
+  J_J
+  deriving (Eq, Ord, Show, Generic)
+
+class CJ x where
+  _J' ::
+    Prism' x ()
+  _J ::
+    x
+  _J =
+    _J' # ()
+
+instance CJ () where
+  _J' =
+    id
+
+instance CJ J_J where
+  _J' =
+    prism'
+      (\() -> J_J)
+      (\J_J -> Just ())
+
+instance CJ Char where
+  _J' =
+    prism'
+      (\() -> 'J')
+      (\c ->  case c of
+                'J' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_J ::
+  (CJ x, CharParsing p) =>
+  p x
+parse_J =
+  _J <$ char 'J' <?> "J"
+
+data K_K =
+  K_K
+  deriving (Eq, Ord, Show, Generic)
+
+class CK x where
+  _K' ::
+    Prism' x ()
+  _K ::
+    x
+  _K =
+    _K' # ()
+
+instance CK () where
+  _K' =
+    id
+
+instance CK K_K where
+  _K' =
+    prism'
+      (\() -> K_K)
+      (\K_K -> Just ())
+
+instance CK Char where
+  _K' =
+    prism'
+      (\() -> 'K')
+      (\c ->  case c of
+                'K' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_K ::
+  (CK x, CharParsing p) =>
+  p x
+parse_K =
+  _K <$ char 'K' <?> "K"
+
+data L_L =
+  L_L
+  deriving (Eq, Ord, Show, Generic)
+
+class CL x where
+  _L' ::
+    Prism' x ()
+  _L ::
+    x
+  _L =
+    _L' # ()
+
+instance CL () where
+  _L' =
+    id
+
+instance CL L_L where
+  _L' =
+    prism'
+      (\() -> L_L)
+      (\L_L -> Just ())
+
+instance CL Char where
+  _L' =
+    prism'
+      (\() -> 'L')
+      (\c ->  case c of
+                'L' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_L ::
+  (CL x, CharParsing p) =>
+  p x
+parse_L =
+  _L <$ char 'L' <?> "L"
+
+data M_M =
+  M_M
+  deriving (Eq, Ord, Show, Generic)
+
+class CM x where
+  _M' ::
+    Prism' x ()
+  _M ::
+    x
+  _M =
+    _M' # ()
+
+instance CM () where
+  _M' =
+    id
+
+instance CM M_M where
+  _M' =
+    prism'
+      (\() -> M_M)
+      (\M_M -> Just ())
+
+instance CM Char where
+  _M' =
+    prism'
+      (\() -> 'M')
+      (\c ->  case c of
+                'M' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_M ::
+  (CM x, CharParsing p) =>
+  p x
+parse_M =
+  _M <$ char 'M' <?> "M"
+
+data N_N =
+  N_N
+  deriving (Eq, Ord, Show, Generic)
+
+class CN x where
+  _N' ::
+    Prism' x ()
+  _N ::
+    x
+  _N =
+    _N' # ()
+
+instance CN () where
+  _N' =
+    id
+
+instance CN N_N where
+  _N' =
+    prism'
+      (\() -> N_N)
+      (\N_N -> Just ())
+
+instance CN Char where
+  _N' =
+    prism'
+      (\() -> 'N')
+      (\c ->  case c of
+                'N' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_N ::
+  (CN x, CharParsing p) =>
+  p x
+parse_N =
+  _N <$ char 'N' <?> "N"
+
+data O_O =
+  O_O
+  deriving (Eq, Ord, Show, Generic)
+
+class CO x where
+  _O' ::
+    Prism' x ()
+  _O ::
+    x
+  _O =
+    _O' # ()
+
+instance CO () where
+  _O' =
+    id
+
+instance CO O_O where
+  _O' =
+    prism'
+      (\() -> O_O)
+      (\O_O -> Just ())
+
+instance CO Char where
+  _O' =
+    prism'
+      (\() -> 'O')
+      (\c ->  case c of
+                'O' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_O ::
+  (CO x, CharParsing p) =>
+  p x
+parse_O =
+  _O <$ char 'O' <?> "O"
+
+data P_P =
+  P_P
+  deriving (Eq, Ord, Show, Generic)
+
+class CP x where
+  _P' ::
+    Prism' x ()
+  _P ::
+    x
+  _P =
+    _P' # ()
+
+instance CP () where
+  _P' =
+    id
+
+instance CP P_P where
+  _P' =
+    prism'
+      (\() -> P_P)
+      (\P_P -> Just ())
+
+instance CP Char where
+  _P' =
+    prism'
+      (\() -> 'P')
+      (\c ->  case c of
+                'P' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_P ::
+  (CP x, CharParsing p) =>
+  p x
+parse_P =
+  _P <$ char 'P' <?> "P"
+
+data Q_Q =
+  Q_Q
+  deriving (Eq, Ord, Show, Generic)
+
+class CQ x where
+  _Q' ::
+    Prism' x ()
+  _Q ::
+    x
+  _Q =
+    _Q' # ()
+
+instance CQ () where
+  _Q' =
+    id
+
+instance CQ Q_Q where
+  _Q' =
+    prism'
+      (\() -> Q_Q)
+      (\Q_Q -> Just ())
+
+instance CQ Char where
+  _Q' =
+    prism'
+      (\() -> 'Q')
+      (\c ->  case c of
+                'Q' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_Q ::
+  (CQ x, CharParsing p) =>
+  p x
+parse_Q =
+  _Q <$ char 'Q' <?> "Q"
+
+data R_R =
+  R_R
+  deriving (Eq, Ord, Show, Generic)
+
+class CR x where
+  _R' ::
+    Prism' x ()
+  _R ::
+    x
+  _R =
+    _R' # ()
+
+instance CR () where
+  _R' =
+    id
+
+instance CR R_R where
+  _R' =
+    prism'
+      (\() -> R_R)
+      (\R_R -> Just ())
+
+instance CR Char where
+  _R' =
+    prism'
+      (\() -> 'R')
+      (\c ->  case c of
+                'R' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_R ::
+  (CR x, CharParsing p) =>
+  p x
+parse_R =
+  _R <$ char 'R' <?> "R"
+
+data S_S =
+  S_S
+  deriving (Eq, Ord, Show, Generic)
+
+class CS x where
+  _S' ::
+    Prism' x ()
+  _S ::
+    x
+  _S =
+    _S' # ()
+
+instance CS () where
+  _S' =
+    id
+
+instance CS S_S where
+  _S' =
+    prism'
+      (\() -> S_S)
+      (\S_S -> Just ())
+
+instance CS Char where
+  _S' =
+    prism'
+      (\() -> 'S')
+      (\c ->  case c of
+                'S' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_S ::
+  (CS x, CharParsing p) =>
+  p x
+parse_S =
+  _S <$ char 'S' <?> "S"
+
+data T_T =
+  T_T
+  deriving (Eq, Ord, Show, Generic)
+
+class CT x where
+  _T' ::
+    Prism' x ()
+  _T ::
+    x
+  _T =
+    _T' # ()
+
+instance CT () where
+  _T' =
+    id
+
+instance CT T_T where
+  _T' =
+    prism'
+      (\() -> T_T)
+      (\T_T -> Just ())
+
+instance CT Char where
+  _T' =
+    prism'
+      (\() -> 'T')
+      (\c ->  case c of
+                'T' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_T ::
+  (CT x, CharParsing p) =>
+  p x
+parse_T =
+  _T <$ char 'T' <?> "T"
+
+data U_U =
+  U_U
+  deriving (Eq, Ord, Show, Generic)
+
+class CU x where
+  _U' ::
+    Prism' x ()
+  _U ::
+    x
+  _U =
+    _U' # ()
+
+instance CU () where
+  _U' =
+    id
+
+instance CU U_U where
+  _U' =
+    prism'
+      (\() -> U_U)
+      (\U_U -> Just ())
+
+instance CU Char where
+  _U' =
+    prism'
+      (\() -> 'U')
+      (\c ->  case c of
+                'U' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_U ::
+  (CU x, CharParsing p) =>
+  p x
+parse_U =
+  _U <$ char 'U' <?> "U"
+
+data V_V =
+  V_V
+  deriving (Eq, Ord, Show, Generic)
+
+class CV x where
+  _V' ::
+    Prism' x ()
+  _V ::
+    x
+  _V =
+    _V' # ()
+
+instance CV () where
+  _V' =
+    id
+
+instance CV V_V where
+  _V' =
+    prism'
+      (\() -> V_V)
+      (\V_V -> Just ())
+
+instance CV Char where
+  _V' =
+    prism'
+      (\() -> 'V')
+      (\c ->  case c of
+                'V' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_V ::
+  (CV x, CharParsing p) =>
+  p x
+parse_V =
+  _V <$ char 'V' <?> "V"
+
+data W_W =
+  W_W
+  deriving (Eq, Ord, Show, Generic)
+
+class CW x where
+  _W' ::
+    Prism' x ()
+  _W ::
+    x
+  _W =
+    _W' # ()
+
+instance CW () where
+  _W' =
+    id
+
+instance CW W_W where
+  _W' =
+    prism'
+      (\() -> W_W)
+      (\W_W -> Just ())
+
+instance CW Char where
+  _W' =
+    prism'
+      (\() -> 'W')
+      (\c ->  case c of
+                'W' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_W ::
+  (CW x, CharParsing p) =>
+  p x
+parse_W =
+  _W <$ char 'W' <?> "W"
+
+data X_X =
+  X_X
+  deriving (Eq, Ord, Show, Generic)
+
+class CX x where
+  _X' ::
+    Prism' x ()
+  _X ::
+    x
+  _X =
+    _X' # ()
+
+instance CX () where
+  _X' =
+    id
+
+instance CX X_X where
+  _X' =
+    prism'
+      (\() -> X_X)
+      (\X_X -> Just ())
+
+instance CX Char where
+  _X' =
+    prism'
+      (\() -> 'X')
+      (\c ->  case c of
+                'X' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_X ::
+  (CX x, CharParsing p) =>
+  p x
+parse_X =
+  _X <$ char 'X' <?> "X"
+
+data Y_Y =
+  Y_Y
+  deriving (Eq, Ord, Show, Generic)
+
+class CY x where
+  _Y' ::
+    Prism' x ()
+  _Y ::
+    x
+  _Y =
+    _Y' # ()
+
+instance CY () where
+  _Y' =
+    id
+
+instance CY Y_Y where
+  _Y' =
+    prism'
+      (\() -> Y_Y)
+      (\Y_Y -> Just ())
+
+instance CY Char where
+  _Y' =
+    prism'
+      (\() -> 'Y')
+      (\c ->  case c of
+                'Y' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_Y ::
+  (CY x, CharParsing p) =>
+  p x
+parse_Y =
+  _Y <$ char 'Y' <?> "Y"
+
+data Z_Z =
+  Z_Z
+  deriving (Eq, Ord, Show, Generic)
+
+class CZ x where
+  _Z' ::
+    Prism' x ()
+  _Z ::
+    x
+  _Z =
+    _Z' # ()
+
+instance CZ () where
+  _Z' =
+    id
+
+instance CZ Z_Z where
+  _Z' =
+    prism'
+      (\() -> Z_Z)
+      (\Z_Z -> Just ())
+
+instance CZ Char where
+  _Z' =
+    prism'
+      (\() -> 'Z')
+      (\c ->  case c of
+                'Z' ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_Z ::
+  (CZ x, CharParsing p) =>
+  p x
+parse_Z =
+  _Z <$ char 'Z' <?> "Z"
+
+----
+
+type IsLower x =
+  (
+    Ca x
+  , Cb x
+  , Cc x
+  , Cd x
+  , Ce x
+  , Cf x
+  , Cg x
+  , Ch x
+  , Ci x
+  , Cj x
+  , Ck x
+  , Cl x
+  , Cm x
+  , Cn x
+  , Co x
+  , Cp x
+  , Cq x
+  , Cr x
+  , Cs x
+  , Ct x
+  , Cu x
+  , Cv x
+  , Cw x
+  , Cx x
+  , Cy x
+  , Cz x
+  )
+
+data Lower =
+  Lower_a
+  | Lower_b
+  | Lower_c
+  | Lower_d
+  | Lower_e
+  | Lower_f
+  | Lower_g
+  | Lower_h
+  | Lower_i
+  | Lower_j
+  | Lower_k
+  | Lower_l
+  | Lower_m
+  | Lower_n
+  | Lower_o
+  | Lower_p
+  | Lower_q
+  | Lower_r
+  | Lower_s
+  | Lower_t
+  | Lower_u
+  | Lower_v
+  | Lower_w
+  | Lower_x
+  | Lower_y
+  | Lower_z
+  deriving (Eq, Ord, Show, Generic)
+
+instance Ca Lower where
+  _a' =
+    prism'
+      (\() -> Lower_a)
+      (\c ->  case c of
+                Lower_a ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cb Lower where
+  _b' =
+    prism'
+      (\() -> Lower_b)
+      (\c ->  case c of
+                Lower_b ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cc Lower where
+  _c' =
+    prism'
+      (\() -> Lower_c)
+      (\c ->  case c of
+                Lower_c ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cd Lower where
+  _d' =
+    prism'
+      (\() -> Lower_d)
+      (\c ->  case c of
+                Lower_d ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Ce Lower where
+  _e' =
+    prism'
+      (\() -> Lower_e)
+      (\c ->  case c of
+                Lower_e ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cf Lower where
+  _f' =
+    prism'
+      (\() -> Lower_f)
+      (\c ->  case c of
+                Lower_f ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cg Lower where
+  _g' =
+    prism'
+      (\() -> Lower_g)
+      (\c ->  case c of
+                Lower_g ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Ch Lower where
+  _h' =
+    prism'
+      (\() -> Lower_h)
+      (\c ->  case c of
+                Lower_h ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Ci Lower where
+  _i' =
+    prism'
+      (\() -> Lower_i)
+      (\c ->  case c of
+                Lower_i ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cj Lower where
+  _j' =
+    prism'
+      (\() -> Lower_j)
+      (\c ->  case c of
+                Lower_j ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Ck Lower where
+  _k' =
+    prism'
+      (\() -> Lower_k)
+      (\c ->  case c of
+                Lower_k ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cl Lower where
+  _l' =
+    prism'
+      (\() -> Lower_l)
+      (\c ->  case c of
+                Lower_l ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cm Lower where
+  _m' =
+    prism'
+      (\() -> Lower_m)
+      (\c ->  case c of
+                Lower_m ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cn Lower where
+  _n' =
+    prism'
+      (\() -> Lower_n)
+      (\c ->  case c of
+                Lower_n ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Co Lower where
+  _o' =
+    prism'
+      (\() -> Lower_o)
+      (\c ->  case c of
+                Lower_o ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cp Lower where
+  _p' =
+    prism'
+      (\() -> Lower_p)
+      (\c ->  case c of
+                Lower_p ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cq Lower where
+  _q' =
+    prism'
+      (\() -> Lower_q)
+      (\c ->  case c of
+                Lower_q ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cr Lower where
+  _r' =
+    prism'
+      (\() -> Lower_r)
+      (\c ->  case c of
+                Lower_r ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cs Lower where
+  _s' =
+    prism'
+      (\() -> Lower_s)
+      (\c ->  case c of
+                Lower_s ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Ct Lower where
+  _t' =
+    prism'
+      (\() -> Lower_t)
+      (\c ->  case c of
+                Lower_t ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cu Lower where
+  _u' =
+    prism'
+      (\() -> Lower_u)
+      (\c ->  case c of
+                Lower_u ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cv Lower where
+  _v' =
+    prism'
+      (\() -> Lower_v)
+      (\c ->  case c of
+                Lower_v ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cw Lower where
+  _w' =
+    prism'
+      (\() -> Lower_w)
+      (\c ->  case c of
+                Lower_w ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cx Lower where
+  _x' =
+    prism'
+      (\() -> Lower_x)
+      (\c ->  case c of
+                Lower_x ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cy Lower where
+  _y' =
+    prism'
+      (\() -> Lower_y)
+      (\c ->  case c of
+                Lower_y ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance Cz Lower where
+  _z' =
+    prism'
+      (\() -> Lower_z)
+      (\c ->  case c of
+                Lower_z ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_lower ::
+  (IsLower x, CharParsing p) =>
+  p x
+parse_lower =
+  parse_a <|>
+  parse_b <|>
+  parse_c <|>
+  parse_d <|>
+  parse_e <|>
+  parse_f <|>
+  parse_g <|>
+  parse_h <|>
+  parse_i <|>
+  parse_j <|>
+  parse_k <|>
+  parse_l <|>
+  parse_m <|>
+  parse_n <|>
+  parse_o <|>
+  parse_p <|>
+  parse_q <|>
+  parse_r <|>
+  parse_s <|>
+  parse_t <|>
+  parse_u <|>
+  parse_v <|>
+  parse_w <|>
+  parse_x <|>
+  parse_y <|>
+  parse_z
+
+type IsUpper x =
+  (
+    CA x
+  , CB x
+  , CC x
+  , CD x
+  , CE x
+  , CF x
+  , CG x
+  , CH x
+  , CI x
+  , CJ x
+  , CK x
+  , CL x
+  , CM x
+  , CN x
+  , CO x
+  , CP x
+  , CQ x
+  , CR x
+  , CS x
+  , CT x
+  , CU x
+  , CV x
+  , CW x
+  , CX x
+  , CY x
+  , CZ x
+  )
+
+data Upper =
+  Upper_A
+  | Upper_B
+  | Upper_C
+  | Upper_D
+  | Upper_E
+  | Upper_F
+  | Upper_G
+  | Upper_H
+  | Upper_I
+  | Upper_J
+  | Upper_K
+  | Upper_L
+  | Upper_M
+  | Upper_N
+  | Upper_O
+  | Upper_P
+  | Upper_Q
+  | Upper_R
+  | Upper_S
+  | Upper_T
+  | Upper_U
+  | Upper_V
+  | Upper_W
+  | Upper_X
+  | Upper_Y
+  | Upper_Z
+  deriving (Eq, Ord, Show, Generic)
+
+instance CA Upper where
+  _A' =
+    prism'
+      (\() -> Upper_A)
+      (\c ->  case c of
+                Upper_A ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CB Upper where
+  _B' =
+    prism'
+      (\() -> Upper_B)
+      (\c ->  case c of
+                Upper_B ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CC Upper where
+  _C' =
+    prism'
+      (\() -> Upper_C)
+      (\c ->  case c of
+                Upper_C ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CD Upper where
+  _D' =
+    prism'
+      (\() -> Upper_D)
+      (\c ->  case c of
+                Upper_D ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CE Upper where
+  _E' =
+    prism'
+      (\() -> Upper_E)
+      (\c ->  case c of
+                Upper_E ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CF Upper where
+  _F' =
+    prism'
+      (\() -> Upper_F)
+      (\c ->  case c of
+                Upper_F ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CG Upper where
+  _G' =
+    prism'
+      (\() -> Upper_G)
+      (\c ->  case c of
+                Upper_G ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CH Upper where
+  _H' =
+    prism'
+      (\() -> Upper_H)
+      (\c ->  case c of
+                Upper_H ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CI Upper where
+  _I' =
+    prism'
+      (\() -> Upper_I)
+      (\c ->  case c of
+                Upper_I ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CJ Upper where
+  _J' =
+    prism'
+      (\() -> Upper_J)
+      (\c ->  case c of
+                Upper_J ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CK Upper where
+  _K' =
+    prism'
+      (\() -> Upper_K)
+      (\c ->  case c of
+                Upper_K ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CL Upper where
+  _L' =
+    prism'
+      (\() -> Upper_L)
+      (\c ->  case c of
+                Upper_L ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CM Upper where
+  _M' =
+    prism'
+      (\() -> Upper_M)
+      (\c ->  case c of
+                Upper_M ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CN Upper where
+  _N' =
+    prism'
+      (\() -> Upper_N)
+      (\c ->  case c of
+                Upper_N ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CO Upper where
+  _O' =
+    prism'
+      (\() -> Upper_O)
+      (\c ->  case c of
+                Upper_O ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CP Upper where
+  _P' =
+    prism'
+      (\() -> Upper_P)
+      (\c ->  case c of
+                Upper_P ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CQ Upper where
+  _Q' =
+    prism'
+      (\() -> Upper_Q)
+      (\c ->  case c of
+                Upper_Q ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CR Upper where
+  _R' =
+    prism'
+      (\() -> Upper_R)
+      (\c ->  case c of
+                Upper_R ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CS Upper where
+  _S' =
+    prism'
+      (\() -> Upper_S)
+      (\c ->  case c of
+                Upper_S ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CT Upper where
+  _T' =
+    prism'
+      (\() -> Upper_T)
+      (\c ->  case c of
+                Upper_T ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CU Upper where
+  _U' =
+    prism'
+      (\() -> Upper_U)
+      (\c ->  case c of
+                Upper_U ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CV Upper where
+  _V' =
+    prism'
+      (\() -> Upper_V)
+      (\c ->  case c of
+                Upper_V ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CW Upper where
+  _W' =
+    prism'
+      (\() -> Upper_W)
+      (\c ->  case c of
+                Upper_W ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CX Upper where
+  _X' =
+    prism'
+      (\() -> Upper_X)
+      (\c ->  case c of
+                Upper_X ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CY Upper where
+  _Y' =
+    prism'
+      (\() -> Upper_Y)
+      (\c ->  case c of
+                Upper_Y ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+instance CZ Upper where
+  _Z' =
+    prism'
+      (\() -> Upper_Z)
+      (\c ->  case c of
+                Upper_Z ->
+                  Just ()
+                _ ->
+                  Nothing)
+
+parse_upper ::
+  (IsUpper x, CharParsing p) =>
+  p x
+parse_upper =
+  parse_A <|>
+  parse_B <|>
+  parse_C <|>
+  parse_D <|>
+  parse_E <|>
+  parse_F <|>
+  parse_G <|>
+  parse_H <|>
+  parse_I <|>
+  parse_J <|>
+  parse_K <|>
+  parse_L <|>
+  parse_M <|>
+  parse_N <|>
+  parse_O <|>
+  parse_P <|>
+  parse_Q <|>
+  parse_R <|>
+  parse_S <|>
+  parse_T <|>
+  parse_U <|>
+  parse_V <|>
+  parse_W <|>
+  parse_X <|>
+  parse_Y <|>
+  parse_Z
+
+type IsAlpha x =
+  (
+    IsLower x
+  , IsUpper x
+  )
+
+data Alpha =
+  AlphaLower Lower
+  | AlphaUpper Upper
+  deriving (Eq, Ord, Show, Generic)
+
+_AlphaLower ::
+  Prism'
+    Alpha
+    Lower
+_AlphaLower =
+  prism'
+    AlphaLower    
+    (\c ->  case c of
+              AlphaLower l ->
+                Just l
+              AlphaUpper _ ->
+                Nothing)
+
+_AlphaUpper ::
+  Prism'
+    Alpha
+    Upper
+_AlphaUpper =
+  prism'
+    AlphaUpper    
+    (\c ->  case c of
+              AlphaUpper l ->
+                Just l
+              AlphaLower _ ->
+                Nothing)
+instance Ca Alpha where
+  _a' =
+    _AlphaLower . _a'
+
+
+instance Cb Alpha where
+  _b' =
+    _AlphaLower . _b'
+
+
+instance Cc Alpha where
+  _c' =
+    _AlphaLower . _c'
+
+
+instance Cd Alpha where
+  _d' =
+    _AlphaLower . _d'
+
+
+instance Ce Alpha where
+  _e' =
+    _AlphaLower . _e'
+
+
+instance Cf Alpha where
+  _f' =
+    _AlphaLower . _f'
+
+
+instance Cg Alpha where
+  _g' =
+    _AlphaLower . _g'
+
+
+instance Ch Alpha where
+  _h' =
+    _AlphaLower . _h'
+
+
+instance Ci Alpha where
+  _i' =
+    _AlphaLower . _i'
+
+
+instance Cj Alpha where
+  _j' =
+    _AlphaLower . _j'
+
+
+instance Ck Alpha where
+  _k' =
+    _AlphaLower . _k'
+
+
+instance Cl Alpha where
+  _l' =
+    _AlphaLower . _l'
+
+
+instance Cm Alpha where
+  _m' =
+    _AlphaLower . _m'
+
+
+instance Cn Alpha where
+  _n' =
+    _AlphaLower . _n'
+
+
+instance Co Alpha where
+  _o' =
+    _AlphaLower . _o'
+
+
+instance Cp Alpha where
+  _p' =
+    _AlphaLower . _p'
+
+
+instance Cq Alpha where
+  _q' =
+    _AlphaLower . _q'
+
+
+instance Cr Alpha where
+  _r' =
+    _AlphaLower . _r'
+
+
+instance Cs Alpha where
+  _s' =
+    _AlphaLower . _s'
+
+
+instance Ct Alpha where
+  _t' =
+    _AlphaLower . _t'
+
+
+instance Cu Alpha where
+  _u' =
+    _AlphaLower . _u'
+
+
+instance Cv Alpha where
+  _v' =
+    _AlphaLower . _v'
+
+
+instance Cw Alpha where
+  _w' =
+    _AlphaLower . _w'
+
+
+instance Cx Alpha where
+  _x' =
+    _AlphaLower . _x'
+
+
+instance Cy Alpha where
+  _y' =
+    _AlphaLower . _y'
+
+
+instance Cz Alpha where
+  _z' =
+    _AlphaLower . _z'
+
+instance CA Alpha where
+  _A' =
+    _AlphaUpper . _A'
+
+
+instance CB Alpha where
+  _B' =
+    _AlphaUpper . _B'
+
+
+instance CC Alpha where
+  _C' =
+    _AlphaUpper . _C'
+
+
+instance CD Alpha where
+  _D' =
+    _AlphaUpper . _D'
+
+
+instance CE Alpha where
+  _E' =
+    _AlphaUpper . _E'
+
+
+instance CF Alpha where
+  _F' =
+    _AlphaUpper . _F'
+
+
+instance CG Alpha where
+  _G' =
+    _AlphaUpper . _G'
+
+
+instance CH Alpha where
+  _H' =
+    _AlphaUpper . _H'
+
+
+instance CI Alpha where
+  _I' =
+    _AlphaUpper . _I'
+
+
+instance CJ Alpha where
+  _J' =
+    _AlphaUpper . _J'
+
+
+instance CK Alpha where
+  _K' =
+    _AlphaUpper . _K'
+
+
+instance CL Alpha where
+  _L' =
+    _AlphaUpper . _L'
+
+
+instance CM Alpha where
+  _M' =
+    _AlphaUpper . _M'
+
+
+instance CN Alpha where
+  _N' =
+    _AlphaUpper . _N'
+
+
+instance CO Alpha where
+  _O' =
+    _AlphaUpper . _O'
+
+
+instance CP Alpha where
+  _P' =
+    _AlphaUpper . _P'
+
+
+instance CQ Alpha where
+  _Q' =
+    _AlphaUpper . _Q'
+
+
+instance CR Alpha where
+  _R' =
+    _AlphaUpper . _R'
+
+
+instance CS Alpha where
+  _S' =
+    _AlphaUpper . _S'
+
+
+instance CT Alpha where
+  _T' =
+    _AlphaUpper . _T'
+
+
+instance CU Alpha where
+  _U' =
+    _AlphaUpper . _U'
+
+
+instance CV Alpha where
+  _V' =
+    _AlphaUpper . _V'
+
+
+instance CW Alpha where
+  _W' =
+    _AlphaUpper . _W'
+
+
+instance CX Alpha where
+  _X' =
+    _AlphaUpper . _X'
+
+
+instance CY Alpha where
+  _Y' =
+    _AlphaUpper . _Y'
+
+
+instance CZ Alpha where
+  _Z' =
+    _AlphaUpper . _Z'
+
+parse_alpha ::
+  (IsAlpha x, CharParsing p) =>
+  p x
+parse_alpha =
+  parse_lower <|>
+  parse_upper
+
+lookup1 ::
+  Eq a =>
+  a
+  -> NonEmpty (a, b)
+  -> b
+lookup1 a ((_, q) :| t) =
+  fromMaybe q (lookup a t)
+
+lowerupper ::
+  Iso'
+    Lower
+    Upper
+lowerupper =
+  let r =
+        (Lower_a, Upper_A) :|
+        [
+          (Lower_b, Upper_B)
+        , (Lower_c, Upper_C)
+        , (Lower_d, Upper_D)
+        , (Lower_e, Upper_E)
+        , (Lower_f, Upper_F)
+        , (Lower_g, Upper_G)
+        , (Lower_h, Upper_H)
+        , (Lower_i, Upper_I)
+        , (Lower_j, Upper_J)
+        , (Lower_k, Upper_K)
+        , (Lower_l, Upper_L)
+        , (Lower_m, Upper_M)
+        , (Lower_n, Upper_N)
+        , (Lower_o, Upper_O)
+        , (Lower_p, Upper_P)
+        , (Lower_q, Upper_Q)
+        , (Lower_r, Upper_R)
+        , (Lower_s, Upper_S)
+        , (Lower_t, Upper_T)
+        , (Lower_u, Upper_U)
+        , (Lower_v, Upper_V)
+        , (Lower_w, Upper_W)
+        , (Lower_x, Upper_X)
+        , (Lower_y, Upper_Y)
+        , (Lower_z, Upper_Z)
+        ]
+  in  iso
+        (`lookup1` r)
+        (`lookup1` ((\(m, n) -> (n, m)) <$> r))
+
+upperlower ::
+  Iso'
+    Upper
+    Lower
+upperlower =
+  from lowerupper
+
+rotate1Lower ::
+  Iso'
+    Lower
+    Lower
+rotate1Lower =
+  let r =
+        (Lower_a, Lower_b) :|
+        [
+          (Lower_b, Lower_c)
+        , (Lower_c, Lower_d)
+        , (Lower_d, Lower_e)
+        , (Lower_e, Lower_f)
+        , (Lower_f, Lower_g)
+        , (Lower_g, Lower_h)
+        , (Lower_h, Lower_i)
+        , (Lower_i, Lower_j)
+        , (Lower_j, Lower_k)
+        , (Lower_k, Lower_l)
+        , (Lower_l, Lower_m)
+        , (Lower_m, Lower_n)
+        , (Lower_n, Lower_o)
+        , (Lower_o, Lower_p)
+        , (Lower_p, Lower_q)
+        , (Lower_q, Lower_r)
+        , (Lower_r, Lower_s)
+        , (Lower_s, Lower_t)
+        , (Lower_t, Lower_u)
+        , (Lower_u, Lower_v)
+        , (Lower_v, Lower_w)
+        , (Lower_w, Lower_x)
+        , (Lower_x, Lower_y)
+        , (Lower_y, Lower_z)
+        , (Lower_z, Lower_a)
+        ]
+  in  iso
+        (`lookup1` r)
+        (`lookup1` ((\(m, n) -> (n, m)) <$> r))
+
+rotate1Upper ::
+  Iso'
+    Upper
+    Upper
+rotate1Upper =
+  let r =
+        (Upper_A, Upper_B) :|
+        [
+          (Upper_B, Upper_C)
+        , (Upper_C, Upper_D)
+        , (Upper_D, Upper_E)
+        , (Upper_E, Upper_F)
+        , (Upper_F, Upper_G)
+        , (Upper_G, Upper_H)
+        , (Upper_H, Upper_I)
+        , (Upper_I, Upper_J)
+        , (Upper_J, Upper_K)
+        , (Upper_K, Upper_L)
+        , (Upper_L, Upper_M)
+        , (Upper_M, Upper_N)
+        , (Upper_N, Upper_O)
+        , (Upper_O, Upper_P)
+        , (Upper_P, Upper_Q)
+        , (Upper_Q, Upper_R)
+        , (Upper_R, Upper_S)
+        , (Upper_S, Upper_T)
+        , (Upper_T, Upper_U)
+        , (Upper_U, Upper_V)
+        , (Upper_V, Upper_W)
+        , (Upper_W, Upper_X)
+        , (Upper_X, Upper_Y)
+        , (Upper_Y, Upper_Z)
+        , (Upper_Z, Upper_A)
+        ]
+  in  iso
+        (`lookup1` r)
+        (`lookup1` ((\(m, n) -> (n, m)) <$> r))
+
+rotate1Alpha ::
+  Iso'
+    Alpha
+    Alpha
+rotate1Alpha =
+  iso
+    (\a ->  case a of
+              AlphaLower l ->
+                AlphaLower
+                  (l ^. rotate1Lower)
+              AlphaUpper u ->
+                AlphaUpper
+                  (u ^. rotate1Upper))
+    (\a ->  case a of
+              AlphaLower l ->
+                AlphaLower
+                  (rotate1Lower # l)
+              AlphaUpper u ->
+                AlphaUpper
+                  (rotate1Upper # u))
+
+mirrorLower ::
+  Iso'
+    Lower
+    Lower
+mirrorLower =
+  let r =
+        (Lower_a, Lower_z) :|
+        [
+          (Lower_b, Lower_y)
+        , (Lower_c, Lower_x)
+        , (Lower_d, Lower_w)
+        , (Lower_e, Lower_v)
+        , (Lower_f, Lower_u)
+        , (Lower_g, Lower_t)
+        , (Lower_h, Lower_s)
+        , (Lower_i, Lower_r)
+        , (Lower_j, Lower_q)
+        , (Lower_k, Lower_p)
+        , (Lower_l, Lower_o)
+        , (Lower_m, Lower_n)
+        , (Lower_n, Lower_m)
+        , (Lower_o, Lower_l)
+        , (Lower_p, Lower_k)
+        , (Lower_q, Lower_j)
+        , (Lower_r, Lower_i)
+        , (Lower_s, Lower_h)
+        , (Lower_t, Lower_g)
+        , (Lower_u, Lower_f)
+        , (Lower_v, Lower_e)
+        , (Lower_w, Lower_d)
+        , (Lower_x, Lower_c)
+        , (Lower_y, Lower_b)
+        , (Lower_z, Lower_a)
+        ]
+  in  involuted
+        (`lookup1` r)
+
+mirrorUpper ::
+  Iso'
+    Upper
+    Upper
+mirrorUpper =
+  let r =
+        (Upper_A, Upper_Z) :|
+        [
+          (Upper_B, Upper_Y)
+        , (Upper_C, Upper_X)
+        , (Upper_D, Upper_W)
+        , (Upper_E, Upper_V)
+        , (Upper_F, Upper_U)
+        , (Upper_G, Upper_T)
+        , (Upper_H, Upper_S)
+        , (Upper_I, Upper_R)
+        , (Upper_J, Upper_Q)
+        , (Upper_K, Upper_P)
+        , (Upper_L, Upper_O)
+        , (Upper_M, Upper_N)
+        , (Upper_N, Upper_M)
+        , (Upper_O, Upper_L)
+        , (Upper_P, Upper_K)
+        , (Upper_Q, Upper_J)
+        , (Upper_R, Upper_I)
+        , (Upper_S, Upper_H)
+        , (Upper_T, Upper_G)
+        , (Upper_U, Upper_F)
+        , (Upper_V, Upper_E)
+        , (Upper_W, Upper_D)
+        , (Upper_X, Upper_C)
+        , (Upper_Y, Upper_B)
+        , (Upper_Z, Upper_A)
+        ]
+  in  involuted
+        (`lookup1` r)
+
+mirrorAlpha ::
+  Iso'
+    Alpha
+    Alpha
+mirrorAlpha =
+  iso
+    (\a ->  case a of
+              AlphaLower l ->
+                AlphaLower
+                  (l ^. mirrorLower)
+              AlphaUpper u ->
+                AlphaUpper
+                  (u ^. mirrorUpper))
+    (\a ->  case a of
+              AlphaLower l ->
+                AlphaLower
+                  (mirrorLower # l)
+              AlphaUpper u ->
+                AlphaUpper
+                  (mirrorUpper # u))
diff --git a/test/Main.hs b/test/Main.hs
new file mode 100644
--- /dev/null
+++ b/test/Main.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+
+module Main(
+  main
+) where
+
+import Control.Applicative(pure)
+import System.IO(IO)
+
+main ::
+  IO ()
+main = 
+  pure ()
diff --git a/test/doctests.hs b/test/doctests.hs
deleted file mode 100644
--- a/test/doctests.hs
+++ /dev/null
@@ -1,32 +0,0 @@
-module Main where
-
-import Build_doctests (deps)
-import Control.Applicative
-import Control.Monad
-import Data.List
-import System.Directory
-import System.FilePath
-import Test.DocTest
-
-main ::
-  IO ()
-main =
-  getSources >>= \sources -> doctest $
-      "-isrc"
-    : "-idist/build/autogen"
-    : "-optP-include"
-    : "-optPdist/build/autogen/cabal_macros.h"
-    : "-hide-all-packages"
-    : map ("-package="++) deps ++ sources
-
-getSources :: IO [FilePath]
-getSources = filter (isSuffixOf ".hs") <$> go "src"
-  where
-    go dir = do
-      (dirs, files) <- getFilesAndDirectories dir
-      (files ++) . concat <$> mapM go dirs
-
-getFilesAndDirectories :: FilePath -> IO ([FilePath], [FilePath])
-getFilesAndDirectories dir = do
-  c <- map (dir </>) . filter (`notElem` ["..", "."]) <$> getDirectoryContents dir
-  (,) <$> filterM doesDirectoryExist c <*> filterM doesFileExist c
