-- | Force an expression, unless it's a built-in function which
-- doesn't need to be forced.
force :: Expression -> Expression
force e
  -- | Known function name?
  | any ((e==) . Variable . Identifier . encodeNameParts) supported = e
  -- | It's a method call on a dictionary, which don't need to be forced.
  | Apply (Variable (Identifier name)) _ <- e,
    isMethod name  = e
  --
  | otherwise = Apply (Variable (Identifier "_"))
                      [e]
force :: Expression -> Expression
force e
  -- | Known function name?
  | any ((e==) . Variable . Identifier . encodeNameParts) supported = e
  -- | It's a method call on a dictionary, which don't need to be forced.
  | Apply (Variable (Identifier name)) _ <- e,
    isMethod name  = e
  --
  | otherwise = Apply (Variable (Identifier "_"))
                      [e]
force e
  -- | Known function name?
  | any ((e==) . Variable . Identifier . encodeNameParts) supported = e
  -- | It's a method call on a dictionary, which don't need to be forced.
  | Apply (Variable (Identifier name)) _ <- e,
    isMethod name  = e
  --
  | otherwise = Apply (Variable (Identifier "_"))
                      [e]