Personal tools

Cookbook/Compilers and interpreters

From HaskellWiki

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

Revision as of 08:19, 31 August 2009

1 GHC

2 GHCi

Problem Solution Examples
checking types  :t
Prelude> :t "Hello"
"Hello" :: [Char]