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

  • SEARCH
  • Home
  • 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 7722483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:11:11+00:00 2026-06-01T04:11:11+00:00

In Haskell function type ( -> ) is given, it’s not an algebraic data

  • 0

In Haskell function type (->) is given, it’s not an algebraic data type constructor and one cannot re-implement it to be identical to (->).

So I wonder, what languages will allow me to write my version of (->)? How does this property called?

UPD Reformulations of the question thanks to the discussion:

Which languages don’t have -> as a primitive type?

Why -> is necessary primitive?

  • 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-01T04:11:14+00:00Added an answer on June 1, 2026 at 4:11 am

    Do you mean meta-circular evaluators like in SICP? Being able to write your own DSL? If you create your own “function type”, you’ll have to take care of “applying” it, yourself.

    Just as an example, you could create your own “function” in C for instance, with a look-up table holding function pointers, and use integers as functions. You’d have to provide your own “call” function for such “functions”, of course:

    void call( unsigned int function, int data) { 
      lookup_table[function](data);
    }
    

    You’d also probably want some means of creating more complex functions from primitive ones, for instance using arrays of ints to signify sequential execution of your “primitive functions” 1, 2, 3, ... and end up inventing whole new language for yourself.

    I think early assemblers had no ability to create callable “macros” and had to use GOTO.

    You could use trampolining to simulate function calls. You could have only global variables store, with shallow binding perhaps. In such language “functions” would be definable, though not primitive type.

    So having functions in a language is not necessary, though it is convenient.

    In Common Lisp defun is nothing but a macro associating a name and a callable object (though lambda is still a built-in). In AutoLisp originally there was no special function type at all, and functions were represented directly by quoted lists of s-expressions, with first element an arguments list. You can construct your function through use of cons and list functions, from symbols, directly, in AutoLisp:

    (setq a (list (cons 'x NIL) '(+ 1 x)))
    (a 5)
    ==> 6
    

    Some languages (like Python) support more than one primitive function type, each with its calling protocol – namely, generators support multiple re-entry and returns (even if syntactically through the use of same def keyword). You can easily imagine a language which would let you define your own calling protocol, thus creating new function types.

    Edit: as an example consider dealing with multiple arguments in a function call, the choice between automatic currying or automatical optional args etc. In Common LISP say, you could easily create yourself two different call macros to directly represent the two calling protocols. Consider functions returning multiple values not through a kludge of aggregates (tuples, in Haskell), but directly into designated recepient vars/slots. All are different types of functions.

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

Sidebar

Related Questions

Suppose that my Haskell function is given an input, which is supposed to be
Is there some function in haskell that evaluates to (filter p xs, filter (not.p)
I am currently learning Haskell. I am trying to write a function which given
I want to use a Haskell function with the following type :: string ->
How can I learn type of argument at function in Haskell ? In python,
I have the following Haskell code import Data.Int import System.Environment type Coord = (Int16,
I just started learning haskell, and I tried to implement a simple function to
Trying to implement, in Scala, the following Haskell function (from Learn You a Haskell...)
Does Haskell standard library have a function that given a list and a predicate,
I thought that in principle Haskell's type system would forbid calls to impure functions

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.