Skip to content

A general library for higher-kinded data #123

Closed

Description

@chris-martin

Rel8 defines the term "higher-kinded data" as:

Higher-kinded data types are data types of the pattern:

data MyType f =
  MyType { field1 :: Column f T1 OR HK1 f
         , field2 :: Column f T2 OR HK2 f
         , ...
         , fieldN :: Column f Tn OR HKn f
         }

where Tn is any Haskell type, and HKn is any higher-kinded type.

Aside from the specific detail of the Column type family, this notion seems very general! Do y'all think there's any potential for a library that would help others replicate the pattern for other applications? (For example, I have in mind a similar sort of approach to filesystem storage, with database rows and fields corresponding to directories and files.)

Activity

  1. ocharles commented on Jul 21, 2021

    @ocharles
    Contributor

    Maybe! Though I will note I think those libraries maybe already exist. In this space, we have:

    1. https://hackage.haskell.org/package/barbies - probably the one I'd most recommend
    2. https://hackage.haskell.org/package/rank2classes
    3. https://hackage.haskell.org/package/hkd

    and there may be others. So I think we'd have to be confident that we have something substantially different. There's a good chance that if https://ghc-proposals.readthedocs.io/en/latest/proposals/0242-unsaturated-type-families.html makes it into GHC proper, we can drop a lot of what we've had to invent in Rel8 and just use barbies - but that remains to be proven.

  2. locked and limited conversation to collaborators on Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions