Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions to name and form: #948

Closed
Anton-Latukha opened this issue Jun 3, 2021 · 3 comments
Closed

Functions to name and form: #948

Anton-Latukha opened this issue Jun 3, 2021 · 3 comments

Comments

@Anton-Latukha
Copy link
Collaborator

Anton-Latukha commented Jun 3, 2021

Patterns that need a meticulous name:

toValue . f <=< fromValue -- is a frequently used wrapper, transformation from Nix type to Haskell type that can be processed by Haskell function:
-- Great example is @lenth@ builtin:
> lengthNix = toValue . (length :: [NValue t f m] -> Int) <=< fromValue
-- ^ Therefore document `fromValue <-> toValue` & put into introductory course
fromValue{,May} . coerce  -- (fromValue . Deeper) is just one of specialized forms of it
fromValue{,May} @returnType <=< force
fromValue{,May} @returnType <=< demand
addProvenance . Provenance -- `Eval` nv.*P functions should add those which use this patterns & include Provenance constructor into the functions, so just the scope & values are passed
-- > addProvenance (Provenance scope $ NBinary_ span NApp (pure f) Nothing)
-- becomes
-- > mkApplWithProv scope span (pure f) Nothing
-- and
-- > nvClosure (Provenance ..)
-- becomes
-- > mkClosureWithProv scope span ...
@Anton-Latukha Anton-Latukha changed the title Patterns: Functions to name and form: Jun 3, 2021
@layus

This comment has been minimized.

@Anton-Latukha

This comment has been minimized.

@Anton-Latukha

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants