stan-0.1.2.1: Haskell STatic ANalyser
Copyright(c) 2020 Kowainik
LicenseMPL-2.0
MaintainerKowainik <xrom.xkov@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Stan.Hie.MatchType

Description

Some Inspections require to know about types and some mechanism to match types to the given PatternType. This information on types/type expressions is taken from HIE files in a more suitable view.

Let's take a look at the function foo:

foo :: NonEmpty String -> Int

In HIE files it will be stored as an Array like this:

  1 -> Int      []
  2 -> String   []
  3 -> NonEmpty [ 2 ]
  4 -> FunType    3 1

This module contains an implementation of the process of retrieval of this information from there.

Synopsis

Documentation

hieMatchPatternType Source #

Arguments

:: Array TypeIndex HieTypeFlat

Array of all types in HIE file

-> PatternType

Our search query

-> TypeIndex

Index of the current expression type

-> Bool

If matched type is found

Matching function that searches the array of types recursively.