Difference between revisions of "Cookbook/Compilers and interpreters"
< Cookbook
Jump to navigation
Jump to search
m (Cookbook/General hints moved to Cookbook/Compilers and interpreters) |
|||
Line 3: | Line 3: | ||
== GHCi == |
== GHCi == |
||
+ | {| class="wikitable" |
||
− | == Checking Types == |
||
+ | |- |
||
− | To check the type of an expression or function, use the command `:t' |
||
+ | ! Problem |
||
⚫ | |||
+ | ! Solution |
||
− | Prelude> :t x |
||
+ | ! Examples |
||
− | x :: Integer |
||
+ | |- |
||
+ | | checking types |
||
+ | | :t |
||
⚫ | |||
Prelude> :t "Hello" |
Prelude> :t "Hello" |
||
"Hello" :: [Char] |
"Hello" :: [Char] |
||
</haskell> |
</haskell> |
||
+ | |- |
Revision as of 08:19, 31 August 2009
GHC
GHCi
Problem | Solution | Examples |
---|---|---|
checking types | :t | Prelude> :t "Hello"
"Hello" :: [Char]
|