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 guys how to make these php html links codes possible. i have tried
Hey I have a menu(with JQuery) in a div on the left, with all
Hey guys I have about 8 fieldSets and Im iterating over a list. I
Hey all- I have looked this up on here and Google but none of
Hey all i have an XML file that i am trying to loop though.
hey - great coders and haskellers, i'm a haskell freshman and have a problem
Hey all i have two JFrames one is my main login frame, user enters
Hey all, my Computational Science course this semester is entirely in Java. I was
Hey all. Newbie question time. I'm trying to setup JMXQuery to connect to my
Hey peoples, I've been studying Java for a couple of weeks, and have decided

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.