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 8185171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:45:16+00:00 2026-06-07T01:45:16+00:00

I have the following snippet out of an Interpreter: type Ident = String type

  • 0

I have the following snippet out of an Interpreter:

type Ident = String
type Value = Int
type State = Ident -> Value

iniState :: State

iniState = \ident -> error "internal error initial state"


updateS :: State -> (Ident, Value) -> State

updateS s (ident, val) ident' | ident' == ident = val
                              | otherwise = s ident'

where does the ident’ in the pattern of updateS come from?

  • 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-07T01:45:17+00:00Added an answer on June 7, 2026 at 1:45 am

    The third argument is from the Ident argument to the function in the type State.

    Using type defines a synonym for another type (quite literally a synonym). In other words, the following type signatures are all the same:

    State -> (Ident, Value) -> State 
    (Ident -> Value) -> (Ident, Value) -> (Ident -> Value)
    (Ident -> Value) -> (Ident, Value) -> Ident -> Value
    

    (You could also replace Ident with String and Value with Int to do a full expansion.)

    The last one makes it clear that updateS could take 3 parameters: a function Ident -> Value, a pair (Ident, Value) and a single Ident.

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

Sidebar

Related Questions

Can you guys help me figure this out? I have the following JavaScript snippet:
I have following code snippet: class ABC{ public: int a; void print(){cout<<hello<<endl;} }; int
I have the following (snippet) of a kernel. __global__ void plain(int* geneVec, float* probs,
I have the following code snippet. public static void main(String[] args) { short a
I have the following code snippet <s:iterator status=stat value=masterAccountList> <tr> <td><s:property value=name/></td> <td><s:property value=status/></td>
I have the following code snippet: class Cert { public static void main(String[] args)
Consider the following code snippet: String input = Print this; System.out.println(input.matches(\\bthis\\b)); Output false What
I have the following code snippet: public class A { public static void main(String[]
I have the following snippet that loads the images: String imgName = /assets/ +
I have the following code snippet: $(d).ready(function() { $.ajax({ url : http://localhost:8080/ProjTest/TestServlet, type :

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.