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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:39:35+00:00 2026-05-23T04:39:35+00:00

Hey haskellers and haskellettes, is it possible to load a module functions in a

  • 0

Hey haskellers and haskellettes,
is it possible to load a module functions in a list.
in my concrete case i have a list of functions all checked with or

checkRules :: [Nucleotide] -> Bool
checkRules nucs = or $ map ($ nucs) [checkRule1, checkRule2]

i do import checkRule1 and checkRule2 from a seperate module – i don’t know if i will need more of them in the future.

i’d like to have the same functionality look something like

-- import all functions from Rules as rules where
-- :t rules ~~> [([Nucleotide] -> Bool)]

checkRules :: [Nucleotide] -> Bool
checkRules nucs = or $ map ($ nucs) rules

the program sorts Pseudo Nucleotide Sequences in viable and nonviable squences according to given rules.
thanks in advance ε/2


Addendum:
So do i think right – i need:

genList :: File -> TypeSignature -> [TypeSignature]
chckfun :: (a->b) -> TypeSignature -> Bool

at compile time.
but i can’t generate a list of all functions in the module – as they most probably will have not the same type signature and hence not all fit in one list. so i cannot filter given list with chckfun.

  • In order to do this i either want to check the written type signatures in the source file (?) or the inferenced types given by the compiler(?).
  • another problem that comes to my mind is: not every function written in the source file might get exported ?

  • Is this a problem a haskell beginner should try to solve after 5 months of learning – my brain is shaped like a klein’s bottle after all this “compile time thinking”.

  • 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-23T04:39:35+00:00Added an answer on May 23, 2026 at 4:39 am

    There is a nice package on Hackage just for this: language-haskell-extract. In particular, the Template Haskell function functionExtractor takes a regular expression and returns a list of the matching top level bindings as (name, value) pairs. As long as they all have matching types, you’re good to go.

    {-# LANGUAGE TemplateHaskell #-}
    import Language.Haskell.Extract
    
    myFoo = "Hello"
    myBar = "World"
    
    allMyStuff = $(functionExtractor "^my")
    
    main = print allMyStuff
    

    Output:

    [("myFoo", "Hello"), ("myBar", "World")]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all- I have looked this up on here and Google but none of
Hey I have been looking all over the internet and this site for hours
hey - great coders and haskellers, i'm a haskell freshman and have a problem
Hey I have been following gcm tutorial to create gcm-demo-server and a demo-client. All
Hey i have been looking around and i cant find a way to get
*Hey , I have finished developing my app In my iphone apps I have
hey guys having this really simple problem but cant seem to figure out have
Hey guys I have a object sitting in my tile map for spawn point
Hey all i'm getting hung up on how to search a database for a
Hey i have made a countdown, but what i want is a div that

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.