packages feed

funcons-tools-0.1.0.0: manual/Funcons/Core/Abstractions/Force.hs

{-# LANGUAGE OverloadedStrings #-}

module Funcons.Core.Abstractions.Force where

import Funcons.EDSL
import Funcons.Types

library = libFromList [
        ("force", StrictFuncon stepForce)
    ]

force_ = applyFuncon "force"
stepForce [Thunk f]  = compstep (stepTo f)
stepForce vs = sortErr (force_ (fvalues vs)) "cannot force a non-thunk"