Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a value that has a type of Show Int?

According to idris Show Int is a type.

*main> :t Show Int
Show Int : Type

What is of an example of a value that has that type?

*main> :t ?
? : Show Int

What could I replace ? with to get that behavior?

I found the answer to my question here: In Idris, is "Eq a" a type, and can I supply a value for it?

like image 824
michaelmesser Avatar asked Jan 29 '26 06:01

michaelmesser


1 Answers

It is this single instance of the Show typeclass

Show String where
show cs = strCons '"' (showLitString (cast cs) "\"")

defined in Prelude/Show.idr where the typeclass is also defined

like image 60
Markus Avatar answered Jan 31 '26 09:01

Markus