egison-5.0.0: Programming language with non-linear pattern-matching against non-free data
LicenseMIT
Safe HaskellNone
LanguageGHC2021

Language.Egison.Type.Instance

Description

This module provides utilities for matching type class instances.

Synopsis

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