File: Issue62.chs

package info (click to toggle)
c2hs 0.28.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,788 kB
  • sloc: haskell: 6,882; ansic: 1,857; xml: 1,411; makefile: 111
file content (34 lines) | stat: -rwxr-xr-x 693 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module Main where

import Foreign.C
import Foreign.Marshal
import Foreign.Ptr
import Foreign.Storable

#include "issue62.h"

peekToInt :: Ptr CInt -> IO Int
peekToInt p = 
    peek p >>= return . fromIntegral
    
{# fun f1
    { `Int' -- ^ This is a multiline
            -- comment for
            -- para1
    , `Int'
    , `Int' -- ^ comment for para3
    } -> `Int' -- ^ multiline
              -- comment for
              -- result
 #}

{# fun f2
    { `Int'
    , alloca- `Int' peekToInt*  -- ^ comment
                                -- won't appear 
    , alloca- `Int' peekToInt* -- ^ won't appear
    } -> `Int' -- ^ The only comment for result
 #}

main :: IO ()
main = return ()