Skip to content

Opposite categories #9

@treeowl

Description

@treeowl

The only difference between a cons list and a snoc list is the category involved.

newtype Op c a b = Op (c b a)
instance Category c => Category (Op c) where
  id = Op id
  Op x . Op y = Op (y . x)

With this, SnocList c a b is basically the same as ConsList (Op c) a b.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions