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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:23:37+00:00 2026-05-15T05:23:37+00:00

A contrived example: signature A = sig type t val x: t end signature

  • 0

A contrived example:

signature A =
sig
  type t
  val x: t
end

signature B =
sig
  type t
  val y: t
end

signature C = sig include A B end

Obviously, this will cause complaints that type t occurs twice in C. But is there any way to express that I want the two ts to be equated, ending up with:

signature C =
sig
  type t
  val x: t
  val y: t
end

I tried all sorts of silly syntax like include B where type t = A.t, which unsurprisingly didn’t work. Is there something I’ve forgotten to try?

Also, I know that this would be simply answered by checking the language’s syntax for anything obvious (or a lack of), but I couldn’t find a complete grammar anywhere on the internet.

(FWIW, the actual reason I’m trying to do this is Haskell-style monads and such, where a MonadPlus is just a mix of a Monad and an Alternative; at the moment I’m just repeating the contents of ALTERNATIVE in MONAD_PLUS, which strikes me as less than ideal.)

  • 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-05-15T05:23:38+00:00Added an answer on May 15, 2026 at 5:23 am

    You’re hosed. The best you can do is, as Jordan Lewis suggests, use substructures and a sharing clause. To include two different signatures that both define t is always an error. So mixing ALTERNATIVE and MONAD_PLUS in the way you would like just isn’t going to work.

    For a proposal of other things that are wrong with include and how to fix them, see An Expressive Language of Signatures.

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

Sidebar

Related Questions

Take this simple, contrived example: UserRepository.GetAllUsers(); UserRepository.GetUserById(); Inevitably, I will have more complex queries,
In this very contrived example, I have an array with 3 elements that I'm
This is a contrived example that I'm using to hopefully understand R better. Lets
To keep it simple, I'll use this contrived example class (the point is that
In this contrived example, I have a static initialization function that is run at
Say I do this (a contrived example): #include <iostream> #include <fstream> using namespace std;
This is a contrived example, but it illustrates my problem much more concisely then
Consider this contrived, trivial example: var foo = new byte[] {246, 127}; var bar
Here is my contrived example that illustrates what I am attempting to accomplish. I
I realize this is a contrived example, but I want a compile check to

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.