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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:25:05+00:00 2026-06-13T02:25:05+00:00

I have a module that defines and exports a type and type class as

  • 0

I have a module that defines and exports a type and type class as shown below. The problem is that I can’t seem to use a function of the class in this module because there are no instances of the class yet.

this is the GHC error: “The type signature for `aabb’ lacks an accompanying binding”

Is there any way around this problem? Thanks.

module AABB (
 AABB
,Boundable(..)
,aabb
,consume
) where

type AABB = (Vec3,Vec3)

class Boundable a where
aabb ∷  a → AABB

consume ∷  (Boundable a) ⇒ AABB → a → AABB
consume (v0,v1) x = (minV v0 v2, maxV v1 v3)
   where (v2,v3) = aabb x

maxV ∷  Vec3 → Vec3 → Vec3
maxV (Vec3 x0 y0 z0) (Vec3 x1 y1 z1) = Vec3 (max x0 x1) (max y0 y1) (max z0 z1)

minV ∷  Vec3 → Vec3 → Vec3
minV (Vec3 x0 y0 z0) (Vec3 x1 y1 z1) = Vec3 (min x0 x1) (min y0 y1) (min z0 z1)
  • 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-13T02:25:06+00:00Added an answer on June 13, 2026 at 2:25 am

    You need to indent aabb.

    class Boundable a where
        aabb ∷  a → AABB
    

    Or use braces:

    class Boundable a where {
    aabb ∷  a → AABB
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made an image processing module that defines a Pixel type as a
I am attempting to develop a Drupal module that defines the class MyFeedsSyndicationParser. This
I have a python module that defines a number of classes: class A(object): def
We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin
I have module that implements custom content type via NodeAPI hooks ( hook_insert ,
I have this module pattern that stores a bunch of vars. I want to
I have an HTTP Module that I use to clean up the JSON returned
Let's suppose I'm defining a module, and I have some function definitions like this:
I have a module that is being used to create only a few page
I have a module that reads the StandardError of a process. Everything works fine,

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.