Skip to content

Is nickel evaluation lazy? #852

Answered by yannham
Profpatsch asked this question in Q&A
Oct 4, 2022 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

Those are interesting questions, because lazyness indeed comes in many different flavours and definitions.

Nickel is lazy in the usual PLT sense, in that the evaluation is call-by-need, as in Haskell and Nix. If you only need one subfield of a huge configuration, you will only evaluate this field. Let me try to address your other questions:

  • Currently, not entirely, because Nickel needs to peek at the top-level annotation of an import to get its type. Because there is currently no notion of module and interface, if you do

    let mylib = import "lib.ncl" in
    

    and use it at some point in a statically typed context, you need to know the type of mylib. How it is currently done is that all import…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@Profpatsch
Comment options

Comment options

You must be logged in to vote
5 replies
@Profpatsch
Comment options

@yannham
Comment options

@Profpatsch
Comment options

@axelkar
Comment options

@yannham
Comment options

Answer selected by Profpatsch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants