This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// - returns: `true` when dynamic type is `Equatable` and `==` returns `true`, otherwise `false`. | |
func areEquatablyEqual(_ lhs: Any, _ rhs: Any) -> Bool { | |
func receiveLHS<LHS>(_ typedLHS: LHS) -> Bool { | |
guard | |
let rhsAsLHS = rhs as? LHS | |
else { return false } | |
return areEquatablyEqual(typedLHS, rhsAsLHS) | |
} | |
return _openExistential(lhs, do: receiveLHS) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE | |
TypeOperators | |
, TemplateHaskell | |
#-} | |
module Tie where | |
import Prelude hiding ((.), id) | |
import Control.Category | |
import Data.Record.Label |