Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7752349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:46:38+00:00 2026-06-01T11:46:38+00:00

I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc —

  • 0

I have found this piece of code in the Haskell sendfile package:

http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc

-- sendfile64 gives LFS support
foreign import ccall unsafe "sendfile64" c_sendfile
  :: Fd -> Fd -> Ptr (#type off64_t) -> (#type size_t) -> IO (#type ssize_t)

1) What does #type mean and 2) why do I get this error,

[1 of 1] Compiling Linux.Splice     ( splice.hs, splice.o )

splice.hs:40:12: parse error on input `type'

when I myself try to use it as follows?:

ghc --make splice.hs

splice.hs:

{-# LANGUAGE ForeignFunctionInterface #-}

module Linux.Splice where

import Data.Word
import System.Posix.Types

-- SPLICE

 -- fcntl.h
 -- ssize_t splice(
 --   int          fd_in,
 --   loff_t*      off_in,
 --   int          fd_out,
 --   loff_t*      off_out,
 --   size_t       len,
 --   unsigned int flags
 -- );

foreign import ccall unsafe "fnctl.h splice" c_splice
  :: Fd
  -> Ptr (#type {- < parse error -} loff_t)
  -> Fd
  -> Ptr (#type loff_t)
  -> (#type size_t)
  -> Word
  -> IO (#type ssize_t)

(using GHC 7.4.x)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:46:39+00:00Added an answer on June 1, 2026 at 11:46 am

    As pointed out by scdvvc, this uses the C preprocessing macros defined by hsc2hs to customize the code specifically to the system it’s being compiled on. You’d need to use hsc2hs to get the appropriate macros defined for your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
I'm using this piece of code I found ( http://impnerd.com/wordpress-hack-add-post-images-to-your-homepage ) to display the
I found this script: http://code.google.com/p/php-mime-mail-parser/ It does a much better job parsing the email
I have this piece of code: <script language=javascript type=text/jscript> document.write(<img src='http://dm.leadgenesys.com/jpgp.lgt?en=P.........TP_Q=&amp;ur=' + escape(document.referrer) +
I have found this piece of code in a book: void DeleteList(element *head) {
I have this piece of code I found on some blog, that's supposed to
I have found this code for reverse geocoding: var point = new GLatLng (lat[1],long[1]);
I have found this line of code in a game that I study int
I have found this macro while digging in the source code of tweejump game.
I want to force the download of an image. I have found this code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.