| License | MIT |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Language.Egison.Type.Instance
Description
This module provides utilities for matching type class instances.
Synopsis
- findMatchingInstanceForType :: Type -> [InstanceInfo] -> Maybe InstanceInfo
Documentation
findMatchingInstanceForType :: Type -> [InstanceInfo] -> Maybe InstanceInfo Source #
Find a matching instance for a given target type This searches through a list of instances and returns the first one that unifies with the target type Used by both type inference (Infer.hs) and type class expansion (TypeClassExpand.hs) IMPORTANT: Uses unifyStrict to ensure Tensor a does NOT unify with a This prevents incorrectly matching scalar instances as tensor instances