-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
{-# LANGUAGE NoMonomorphismRestriction #-}
import Diagrams.Prelude
aCircleNamedBob :: D R2
aCircleNamedBob = circle 1 # named "bob"
whatIsTheNameOfThisCircle
= case lookupName "bob" aCircleNamedBob of
Nothing -> error "this doesn't happen"
Just c -> getSub c
itTurnsOutTheCircleAboveHasNoName
= case lookupName "bob" whatIsTheNameOfThisCircle of
Nothing -> putStrLn "wah!"
Just bob -> putStrLn "found bob"
main = itTurnsOutTheCircleAboveHasNoName
I would argue that the above program ought to print found bob
, though I am open to other opinions. This bit me when building some animations via keyframing---the diagrams used to build the actual animation are looked-up subdiagrams, so one can no longer use frames of the animation as keyframes for building further animations (since there are no longer any names to match up).
Metadata
Metadata
Assignees
Labels
No labels