bluespec.com Forum Index bluespec.com
Bluespec Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Creating your own monadic functions

 
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ...
View previous topic :: View next topic  
Author Message
garethlloyd



Joined: 19 Mar 2014
Posts: 12

PostPosted: Mon Mar 24, 2014 2:48 pm    Post subject: Creating your own monadic functions Reply with quote

Helper monadic functions exist for Lists and Vectors but not for HList. I'm looking to write a monadic functions such as genWithM and replicateM but for HLists.

Any reference material or help would be appreciated.
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 499

PostPosted: Tue Mar 25, 2014 1:48 am    Post subject: Re: Creating your own monadic functions Reply with quote

Here's a paper about HList:

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.101.9906

Note that HLisn't isn't a data type! It's a typeclass. Underneath, there's a data type, which is essentially just a tuple (or a tree of nested tuples). The HList functions are implemented as typeclasses, which recursively traverse the tree of tuples.

So if genWithM/replicateM can be written, they would need to be written as typeclasses. (And the function argument would need to be generic enough to work for every data type in the HList tuple.)

I'll again say that I'm not convinced that HList will be helpful for you. It's a rarely-used package.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bluespec.com Forum Index -> Designing with BSV's Rules, Interfaces, ... All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
bluespec.com topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP