Skip to content

Givens / Anonymous Implicit Parameters / Ambient Values #323

Open
@AshleyYakeley

Description

Refs

Uses

Ambient equivalences

like Haskell class instances.

Storablility

type Storability t
    LiteralStorability
        t -> Literal
        Literal -> Maybe t
    MkStorability
        t -> Entity

property: Storability a => Storability b => Anchor -> Store -> Property a b

Design

Gives are when givens are provided. Takes are when givens are used.

1. Lexical scope. Given must be in scope of take.

  • can import gives
  • cannot import takes (?)
  • let {?a = 1} let {x = ?a} x => =1
  • let {x = ?a} let {?a = 1} x => unimplied ?a

2. Scope like implicit parameters.

  • Ends up in type signature
  • cannot import gives
  • can import takes
  • take: a => a
  • imply {?a = 1} let {x = ?a} x (non-lexical scope) =1
  • let {x = ?a} imply {?a = 1} x (non-lexical scope) =1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions