Skip to content

Don't export fst (and alike) from Prelude.Linear #405

@andreasabel

Description

@andreasabel

It is surprising that Prelude.Linear exports the non-linear version of projection fst :: (a,b) -> a.
This tripped me up (with non-inspiring errors about multiplicity) when writing evalState:

I was naturally expecting that fst :: Consumable b => (a,b) -> a would be by default in scope if a fst is in scope. After all, we want linear programs when we import Prelude.Linear!
So, I suggest either to not export fst (and alike) or export them from Data.Tuple.Linear.

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