[Haskell-beginners] abstracting parametrized record types

Brandon Allbery allbery.b at gmail.com
Wed Apr 29 23:27:16 UTC 2015


On Thu, Oct 2, 2014 at 7:31 PM, Alia <alia_khouri at yahoo.com> wrote:

> I would like to define a higher-level record type which contains,
> for configuration purposes, a certain set of jobs for execution. Let's
> say we call it a JobSet and which could possibly look like this:
>
> data JobSet = JobSet
>     { jobsetID          :: String
>     , jobsetName        :: String
>     , jobs              :: [Job]  <-- yes I know this is not legal
>     }
>

Are you sure you don't want

    data JobSet a = JobSet
      {jobsetID   :: String
      ,jobsetName :: String
      ,jobs       :: [Job a]
      }
?

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150429/043ad377/attachment.html>


More information about the Beginners mailing list