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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:33:12+00:00 2026-05-26T02:33:12+00:00

having a problem with coding with miranda am just a newbie to functional programming

  • 0

having a problem with coding with miranda am just a newbie to functional programming so slap me hard if ive dont an easy mistake so i learn

anyway i a getting an error on line 12 with having a problem with unifyin char with char my idea is to check is something is spelt right by filtering it with the dictionary wich would be both an list of words and another list from a file added together

this is my line 12

= [filter (= typed) ((read file) ++ dictionary)]

and this is the rest of my program so far

filename == [char]
word  == [ char ]
dictionary :: [ word ]



spell:: filename -> filename -> [ char ]
look:: word -> filename ->[[[ char ]]]


look typed file
= [filter (= typed) ((read file) ++ dictionary)]

dictionary =
["aardvark","bell","camp","dictionary","editor","file","ground",
"grounds","help","intelligent","joint","kettle","light","memory",
"nettle","orange","quite","research","standard","terminal",
"umbrella","violin","water","xenon","yellow","zoo","aaa","abb",
"acc","add","aee"]

so could anyone point out where i’v gone wrong?

  • 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-26T02:33:13+00:00Added an answer on May 26, 2026 at 2:33 am

    I’ve never used Miranda, but having used Haskell, it looks like the problem is that you’re trying to append a string and a list of strings; however, I guess that ++ needs two lists of the same type (as in Haskell):

    (++) :: [a] -> [a] -> [a]
    

    But read file is of type [char], and dictionary is of type [[char]].

    Trying to substitute these into the type signature for ++ causes the type error:

    (++) :: [char] -> [[char]] -> ?? -- type error!!
    

    Maybe you want to split (read file) into words before you append it to dictionary. Then you would be appending [[char]] to [[char]], which will work just fine.

    Note I don’t know anything about Miranda — this answer is based on looking at your code, the error message you gave, and my experience with Haskell (where I’ve made oodles of similar mistakes).

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

Sidebar

Related Questions

this is a hw problem, ive done all the coding but im having trouble
I just started coding a gtalk chat bot using libjingle. I'm having a problem
I'm having a problem where I cannot initialize an array without hard-coding it in
I am coding this layout as a wordpress theme and having a slight problem
I'm coding a simple SDL program with VC10. The problem that I am having
I am currently coding a HTML website into wordpress. The problem that i'm having
I am having a similar problem coding this email for Outlook 2010 (of course).
I'm having a problem using spaces for indenting in Vim. The coding guidelines of
I'm having hardstop with this problem to solve in my Excel macro coding. My
I am having problem with my PHP coding lately. I used to code like

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.