From 5b4887f7ea3262bd0e280be4bb889fd67f708edf Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 7 May 2019 16:15:22 +0200 Subject: Document Value and Thunk --- dhall/src/core/thunk.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'dhall/src/core/thunk.rs') diff --git a/dhall/src/core/thunk.rs b/dhall/src/core/thunk.rs index 69c4347..2b013bb 100644 --- a/dhall/src/core/thunk.rs +++ b/dhall/src/core/thunk.rs @@ -29,12 +29,14 @@ enum ThunkInternal { Value(Marker, Value), } -/// Stores a possibly unevaluated value. Uses RefCell to ensure that -/// the value gets normalized at most once. +/// Stores a possibly unevaluated value. Gets (partially) normalized on-demand, +/// sharing computation automatically. +/// Uses a RefCell to share computation. #[derive(Debug, Clone)] pub struct Thunk(Rc>); -/// A thunk in type position. +/// A thunk in type position. Can optionally store a Type from the typechecking phase to preserve +/// type information through the normalization phase. #[derive(Debug, Clone)] pub(crate) enum TypeThunk { Thunk(Thunk), -- cgit v1.2.3