Skip to content

sop-core: Concatenate a POP into an NP #176

@turion

Description

@turion

This may be out of scope, but I use sop-core as a lean, clean, principled general purpose library for heterogeneous sums and products. As such it is great, but sometimes I'm lacking a feature. For example, concatenation. For homogeneous lists, there is (++) :: [a] -> [a] -> [a] and concat :: [[a]] -> [a], but I believe this doesn't exist in sop-core. I think it should be possible to implement with these type signatures:

type family Concat (xss :: [[k]]) :: [k] where
  ...

hconcat :: POP f xss -> NP f (Concat xss)

Maybe it's already possible to do this with the existing type families, if so, I don't know how. In that case it might be helpful to add a type alias and a function to witness this.

Either way, if you think this works and is a good addition, I'll happily send a PR.

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