在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):sebastiaanvisser/fclabels开源软件地址(OpenSource Url):https://github.com/sebastiaanvisser/fclabels开源编程语言(OpenSource Language):Haskell 99.9%开源软件介绍(OpenSource Introduction):fclabels: first class accessor labelsThis package provides first class labels that can act as bidirectional record fields. The labels can be derived automatically using Template Haskell which means you don't have to write any boilerplate yourself. The labels are implemented as lenses and are fully composable. Lenses can be used to get, set and modify parts of a data type in a consistent way. See Total and partial lensesInternally lenses do not use Haskell functions directly, but are implemented as categories. Categories allow the lenses to be run in custom computational contexts. This approach allows us to make partial lenses that point to fields of multi-constructor datatypes in an elegant way. See Monomorphic and polymorphic lensesWe have both polymorphic and monomorphic lenses. Polymorphic lenses allow updates that change the type. The types of polymorphic lenses are slightly more verbose than their monomorphic counterparts, but their usage is similar. Because monomorphic lenses are built by restricting the types of polymorphic lenses they are essentially the same and can be freely composed with eachother. See Using fclabelsTo simplify working with labels we supply both a set of labels for Haskell's base types, like lists, tuples, Maybe and Either, and we supply a set of combinators for working with labels for values in the Reader and State monad. See On Hackage: http://hackage.haskell.org/package/fclabels Introduction: http://fvisser.nl/post/2013/okt/1/fclabels-2.0.html |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论