funcons-tools-0.1.0.0: manual/Funcons/Core/Computations/DataFlow/Generating/NextAtom.hs
{-# LANGUAGE OverloadedStrings #-}
module Funcons.Core.Computations.DataFlow.Generating.NextAtom where
import Funcons.EDSL
library = libFromList [
("next-atom", ValueOp next_atom)
]
next_atom [Atom k] = rewriteTo (FValue $ Atom (show (k'+1)))
where k' :: Int
k' = read k
next_atom vs = sortErr (applyFuncon "next-atom" (map FValue vs)) "next-atom not applied to an atom"