Skip to content

Instantly share code, notes, and snippets.

/// - 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)
}
{-# LANGUAGE
TypeOperators
, TemplateHaskell
#-}
module Tie where
import Prelude hiding ((.), id)
import Control.Category
import Data.Record.Label