Idris: Type safe printf [video]
youtube.com
Idris: Type safe printf [video]
1–10 of 16 posts
Re: Idris: Type safe printf [video]
#2Idris?
Re: Idris: Type safe printf [video]
#3Idris?
Re: Idris: Type safe printf [video]
#4My mind immediately went to Star Citizen...
Re: Idris: Type safe printf [video]
#5Really cool, but I am assuming printf only works for values which are determined at compile time?
Re: Idris: Type safe printf [video]
#6My mind immediately went to Star Citizen...
Why?
Re: Idris: Type safe printf [video]
#7Really cool, but I am assuming printf only works for values which are determined at compile time?
AFAIK the value of the formatting string needs to be known at compile time. Only the types of the rest need to be known.
Actually, since it's dependently typed, we don't actually need to know the value of the formatting string; we just need a proof that the formatting string will match the other values. The easiest way to do this is to know what the string is, but we could also, for example, get these values from a function, then prove that the function produces matching values.
Re: Idris: Type safe printf [video]
#8Why define Format as
data Format = FInt Format
| FString Format
| FOther Char Format
| FEnd
instead of using lists? data FormatPart = FInt | FString | FOther Char
type Format = List FormatPartRe: Idris: Type safe printf [video]
#9Why define Format as data Format = FInt Format | FString Format | FOther Char Format | FEnd instead of using lists? data FormatPart = FInt | FString | FOther Char type Format = List FormatPart
Seems to work fine: https://gist.github.com/anonymous/18e4d6823de55a4d0567
Re: Idris: Type safe printf [video]
#10This was awesome and yet one more reason to learn Idris. Now I have to see if it can be done in Scala.