c# convert pdf to image open source : Save pdf forms in reader Library control component .net azure asp.net mvc formlenses-bx130-part432

Electronic Communications of the EASST
BX 2013
Lenses for Web Data
RaghuRajkumar,SamLindley,NateFoster, JamesCheney
21pages
PerditaStevensandJamesTerwilliger
ManagingEditors: TizianaMargaria,JuliaPadberg, GabrieleTaentzer
ECEASSTHomePage:http://www.easst.org/eceasst/
ISSN1863-2122
Save pdf forms in reader - extract form data from PDF in C#.net, ASP.NET, MVC, Ajax, WPF
Help to Read and Extract Field Data from PDF with a Convenient C# Solution
extract data from pdf form fields; change font size pdf form reader
Save pdf forms in reader - VB.NET PDF Form Data Read library: extract form data from PDF in vb.net, ASP.NET, MVC, Ajax, WPF
Convenient VB.NET Solution to Read and Extract Field Data from PDF
export excel to pdf form; extract pdf data to excel
ECEASST
Lenses for Web Data
RaghuRajkumar
1
,SamLindley
2
,NateFoster
1
,JamesCheney
3
1
CornellUniversity
2
UniversityofStrathclyde
3
UniversityofEdinburgh
Abstract: Putting data on the web usually involves implementing two transfor-
mations: one to convert the data into HTML, and another to parse modifications
out of interactions with clients. Unfortunately, in current systems, these transfor-
mations aretypicallyimplementedusingtwo separatefunctions—an approachthat
replicates functionality across multiple pieces ofcode, and makes programs diffi-
cultto write,reasonabout,andmaintain. Thispaperpresentsa differentapproach:
an abstraction basedon formlets thatmakes it easy tobridge the gap between data
storedonaserverandvaluesembeddedinHTMLforms. We introduceformlenses,
which combine the advantages of formlets with those of lenses to provide com-
positional, bidirectional form-based views of Webdata. We show that formlenses
canbeviewedas monoidalfunctors overlenses,analogouslytoformlets,whichare
applicative functors. Finally, we investigate the connection between linearity and
bidirectionaltransformations anddescribe atranslationfromalinearpatternsyntax
intoformlenscombinators.
Keywords:Formlets,lenses,applicativefunctors,monoidalfunctors.
1 Introduction
Puttingdata onthewebusuallyinvolves implementing twotransformations: oneto convertthe
data intoHTML, and another to parse modifications outofinteractions with clients. Unfortu-
nately, in current systems, these transformations are typically implemented using two separate
functions—an approach that replicates functionality across multiple pieces ofcode, andmakes
programsdifficulttowrite,reasonabout,andmaintain.
To illustrate, suppose that we have a database of visiting speakers and we want to build an
application that supports viewing and editing this database through a Web browser. Figure1
gives a possible implementation ofthis application in Haskell. The render function converts a
singleSpeakervalueintoHTMLwithanembeddedform,whichallowsausertoeditthedetails
associatedwiththespeakerandsubmitthemodificationsbacktotheserver. Thefunctioncollect
handles these responses by extracting anupdatedSpeaker value outoftheassociationlistEnv,
whichis returnedtotheserverbythebrowser.
Readers unfamiliar with Haskelllanguage can find documentation for the functions used in
this paper athttp://www.haskell.org/hoogle. This example uses several functions based on the
Text:Html module and the standard prelude: inputTag constructs an input element, brTag con-
structsa linebreak, lineToHtml converts a stringto HTML, (+++) concatenatesHTML, lookup
retrievesavaluefromanassociationlistandreturnsaMaybevalue,fromJustextractstheencap-
1/21
C# PDF: PDF Document Viewer & Reader SDK for Windows Forms
file in different display formats, and save source PDF introduction to RasterEdge C#.NET PDF document viewer & reader for Windows Forms application, you
how to fill pdf form in reader; pdf form field recognition
C# PDF: How to Create PDF Document Viewer in C#.NET with
Eaisly save and print designed PDF document using C# code; PDF document viewer can be created in C# Web Forms, Windows Form and mobile applications.
export pdf form data to excel spreadsheet; pdf form save in reader
LensesforWebData
dataDate
=Datefmonth::Int;day::Intg
dataSpeaker=Speakerfname::String;date::Dateg
render::Speaker!Html
render(Speakern(Datemd))=
inputTagfname="name";value=ng+++brTag+++
lineToHtml"Month: "+++inputTagfname="month";value=showmg+++brTag+++
lineToHtml"Day: "
+++inputTagfname="day";value=showdg
dataEnv=[(String;String)]
collect :: Env!Speaker
collecte=letn =fromJust(lookup"name"e)in
letm=read(fromJust(lookup"month"e))in
letd =read(fromJust(lookup"day"e))in
Speakern(Datemd)
Figure1: HaskellcodeforSpeakerexample.
sulatedvaluefroma Maybevalue, showconverts anInttoa String, andread parsesanIntfrom
aString.
Together, the render and collect functions effectively present a single Speaker value on the
Web. But ingeneral, developing applications this way quickly leads to complications: First, it
requires the programmer to explicitly coerce the data to and from HTML—something that is
easytogetwrong, especially inlargerexamples. Second,itrequires themtoconstructtheform
manually, includingchoosingnamesforeachformfield. Althoughthesenamesaresemantically
immaterial they must be globally unique to avoid clashes. Moreover, the field names used by
rendermustbesynchronizedwiththenamesusedbycollect. Theseconstraints makeitdifficult
toconstructformsinacompositionalmanner. Forexample,wecannotiteraterender andcollect
toobtainaprogramforalistofSpeakers becausespecificfieldnamesare“bakedinto”thecode.
Formlets. Inpriorwork,Cooperetal.[CLWY08]introducedahigh-levelabstractionforbuild-
ingWebformscalledformlets.Formletsencapsulateseverallow-leveldetailsincludingselecting
fieldnames forelementsandparsingdatafromclientresponses. Formlets canberepresentedin
Haskellas functions that take a source ofnames—concretely, anInt—as an argument and pro-
duceatripleconsistingofanHTMLdocument,acollectfunction, andamodifiednamesource.
typeFormleta=Int!(Html;Env!a;Int)
Thenamesofanygeneratedformfieldsaredrawnfromthenamesource,andthecollectfunction
looksuppreciselythesenames.
Asasimpleexampleofaformlet,considerthehtmlcombinator,whichgeneratesstaticHTML
withoutanyembeddedformelements,
html
:: Html!Formlet()
htmlhi=(h;l
!();i)
2/ 21
VB.NET Word: .NET Word Reader & Processor Control SDK | Online
How to save target Word file (with desired storage like ASP.NET web application, Windows Forms project and for converting Word document file to PDF, png, gif
extracting data from pdf forms to excel; extracting data from pdf forms
VB.NET PDF: VB Code to Create PDF Windows Viewer Using DocImage
with great capabilities to view, annotate, process, save and scan and BMP) and document files (TIFF, PDF and Word NET, VB.NET, ASP.NET and .NET Windows Forms.
extract data from pdf table; c# read pdf form fields
ECEASST
thetextcombinator,whichwraps plaintextasHTML,
text:: String!Formlet()
texts=html(stringToHtmls)
andtheinputIntcombinator,whichbuildsaformthatacceptsaninteger:
inputInt :: FormletInt
inputInti=letn=showiin
(inputTagfname=n;value=""g;le!read(fromJust(lookupne));i+1)
Combinatorsforotherprimitive typessuchasStringandBoolcanbedefinedsimilarly.
Formlets can be combined into largerformlets usingthe interface ofapplicative functors, a
genericmathematicalstructureforrepresenting computations witheffects [MP08]. Wegivethe
definitionofapplicativefunctorshereusingatypeclass—adescriptionofthefunctionsthateach
applicativefunctorinstances mustprovide.
classFunctorf where
fmap::(a!b)!f a!f b
class(Functorf))Applicativef where
pure::a!f a
( ) ::f (a!b)!f a!f b
Intuitively, the pure function injects a value of type a into the type f a, while   applies the
underlyingfunctiontoitsargument,accumulatingeffects fromlefttoright. Applicativefunctor
instancesareexpectedtoobeythefollowingconditionsrelatingpureand :
pureid u = u
pure() u v w
= u (v w)
puref  purex = pure(f x)
u purex = pure(lf !f x) u
Theapplicativefunctorinstanceforformlets isdefinedasfollows:
instanceApplicativeFormletwhere
pureai =(noHtml;l
!a;i)
(f g)i=let(x;p;i
0
)=f iin
let(y;q;i
00
)=gi
0
in
(x+++y;le!pe(qe);i
00
)
The pure formlet generates empty HTML and has the constant collect function. The render
component of the   operator threads the namesource through its arguments from leftto right
andaccumulatesthegeneratedHTML.Thecollectfunctionapplies thefunction(oftypea!b)
producedbyf tothevalue(oftypea)producedbyg.
Usingtheapplicativefunctorinterfaceandthesimplecombinatorsjustdefined, wecandefine
aformletforSpeakers asfollows:
3/21
C# PDF Convert to Images SDK: Convert PDF to png, gif images in C#
Besides raster image Jpeg, images forms like Png, Bmp, Gif, .NET Description: Convert all the PDF pages to target format images and save them into
how to type into a pdf form in reader; extract data from pdf forms
Save, Print Image in .NET Winforms | Online Tutorials
PDF Generator. PDF Reader. Twain Scanning. DICOM Reading. ISIS & printing capabilities into your Windows Forms applications Save images & documents to the disk; Save
exporting pdf form to excel; sign pdf form reader
LensesforWebData
dateForm::FormletDate
dateForm=pure(l
m
d
!Datemd)
text"Month: " inputInt htmlbr
text"Day: "
inputInt htmlbr
speakerForm::FormletSpeaker
speakerForm=pureSpeaker inputString dateForm
The
argumentsintheanonymous functionsupplied topurediscardthe () values produced by
thetextandhtmlcombinators.
Formlenses. Formletsareausefulabstraction,buttheyonlyaddressonehalfoftheproblem—
theymakeiteasytoconstructafunctionthatproducesavalueoftypea,buttheydonotprovide
awaytodescribeafunctionthatconsumesavalueoftypeaandembedsitinaform. Ofcourse,
programmers could write functions of type a! Formleta (similar to the approach in Hanus’
WUI library [Han06]), but such functions do not support the applicative functor interface (so
large examples would need to be expressed using monolithic programs) and do not guarantee
reasonable behavior(so programmers wouldhave toprovethat values are preservedonround-
trips byhand).
Adifferentwaytothinkaboutthisproblemistoobservethatformsareoftenusedtopresentan
updatableviewofthe underlying data source. The fundamentaldifficultyinputting data onthe
Webstemsfromthefactthatprogrammersaremaintainingtheseviewsmanually,writingexplicit
forwardtransformationsthatputthedataintoforms,andseparatebackwardtransformationsthat
propagate collected values back to the underlying sources. As this terminology suggests, we
haveasolutiontothisprobleminmind: useideasfrombidirectionaltransformations[CFH
+
09]
todefineformlets thatbehavelike updatableviews.
The main goalofthis paperis to show how formlets and bidirectional transformations such
as lenses [FGM
+
07]canbecombined,yieldinganabstractioncalledFormlenses. Aformlens
takes a valueoftype a, renders itas a form thatcanbedispatched totheWeb client, translates
theresponsebacktoanewvalueoftypea, andmerges theresultwiththe oldvalue. Intuitively,
onecanthinkofaFormlensaasabidirectionalmappingbetweenanavalueandawebpagethat
containsaneditablea. Butunlikemanualapproaches, whereprogrammerswrite explicitrender
and collectfunctions, or the approach using functions oftype a!Formleta described above,
wecandesigntheformlensabstractiontosupportcompositionandstrongsemanticguarantees.
Challenges. Combining formlets and lenses turns out to be nontrivial. If a value of type
Formlensaconsumesavalues,thenamustappearinanegativepositioninitstype. Conversely,
ifavalueoftype Formlensaproducesavalues, thenamustappearpositivelyinitstype. These
observationsleadtoseriousproblemsdefiningFormlensasatypeoperatorinHaskell: Formlens
cannot be a covariant Functor over the category Hask of Haskell types and functions, and it
cannotbeacontravariantfunctoroverthiscategoryeither.
Toavoidthisdifficulty,weshiftperspectiveandconsiderfunctorsfromlensesto(thecategory
of)Haskelltypes andfunctions. However, even afterrestricting attention tothese functors, the
applicativefunctorinterfaceisstilltoo strong. Considerthe followinginterface,which general-
izes McBrideandPaterson’s definitiontoallowapplicative functorsonlenses:
4/ 21
C# PDF Page Insert Library: insert pages into PDF file in C#.net
document in both web server-side application and Windows Forms project using doc2.Save(outPutFilePath Add and Insert Multiple PDF Pages to PDF Document Using
extract data from pdf form to excel; how to save fillable pdf form in reader
C# PDF: Start to Create, Load and Save PDF Document
APIs will be used to achieve PDF document saving in void Save(String fileName); void SaveToStream(Stream stream ASP.NET AJAX, Silverlight, Windows Forms as well
export pdf form data to excel; pdf data extraction open source
ECEASST
classLApplicativef where
lpure::a!f a
lapp ::f (Lensab)!f a!f b
ToinstantiateLApplicativeFormlens,wewouldneedtodefinefunctions
lpure::a!Formlensa
lapp ::Formlens(Lensab)!Formlensa!Formlensb
For the latter, we would need to (somehow) combine a form that consumes and produces a
Lensabwithanotherformthatproducesandconsumesanatoobtainaformthatproducesand
consumesa b. This doesnotseempossibletodoinanaturalway. Moreover,froma categorical
perspective, lapp wouldnotmake sensebecause thecategoryoflenses overHaskelltypes does
nothaveexponentialobjects. Thisremainstrueifweconsidercontravariantfunctors.
FortunatelywecansidesteptheseproblemsbyobservingthattheextrastructureofApplicative
functors is not required forFormlets orFormlenses—monoidal structure suffices. By adapting
thebasic ideas ofFormlets todifferent(weaker)mathematicalstructuresweareableto employ
Formletsinabroaderrangeofsettings. Morespecifically,we cancomposeformletswithlenses
whileretainingtheabilitytocomposeformletsusingamonoidalinterface.
Contributions. Overall,this papermakesthefollowingcontributions:
 We presentanew foundation forformlets basedon monoidalfunctors overlenses, which
makesitpossibletogivethemabidirectionalsemantics;
 Wedescribeanimplementationofformlensesas acombinatorlibraryinHaskell;
 We explore the connection between linear syntax and bidirectional transformations and
describeatranslationfromalanguageoflinearpatternsintoformlenscombinators.
The rest of the paper is structured as follows: Section2 presents the design of formlenses
by generalizing the classic definition based on formlets and showing that they are monoidal
functorsoverlenses. Section3describestheformlensimplementation,includingsyntacticsugar
fordescribingformlensesusinglinearpatterns. Section4brieflyreviewsrelatedwork. Section5
concludes. Theappendixpresentsbackgroundmaterialonmonoidalfunctorsthatmaybehelpful
forsomereaders.
2 Formlens Design
This sectiondefines formlenses, the mainabstraction presented in this paper. We begin by re-
viewing the definition of monoidal functors as represented in Haskell. The built-in type class
Functor models functorsfromHask toHask.
classFunctorf where
fmap::(a!b)!f a!f b
5/21
VB.NET Image: How to Save Image & Print Image Using VB.NET
ASP.NET web application or .NET Windows Forms project, without Allow VB.NET developers to save source image file to multi-page document files, like PDF and Word
online form pdf output; extracting data from pdf to excel
VB.NET Word: VB Code to Create Windows Word Viewer | Online
Word documents displaying, processing and printing in .NET Windows Forms project. Word Windows Viewer enables developers to load, view, process, save and print
extract pdf data into excel; save pdf forms in reader
LensesforWebData
Thatis,instancesofFunctorarerequiredtosupplyafunctionfmapthatliftsfunctionsfromato
btofunctions fromf atof b. Toallowformlenses tobothproduceandconsumevalues,wewill
workwithfunctorsfromLenstoHask,whereLensisthecategoryof(asymmetric)lenses,
dataLensab=Lensfget::a!b;put::Maybea!b!ag
wheregetandputmustsatisfy:
put(Justa)(geta) =a --GetPut
get(put(Justa)b)=b --PutGet
get(putNothingb)=b --CreateGet
It is straightforward to show that Lens has an identity and is closed under composition, and
thereforeformsacategory.
Wemodelfunctors fromLens toHask usingthefollowingtypeclass:
classLFunctorf where
lmap::Lensab!f b!f a
Fortechnicalreasons,weusethecontravariantformulation: givenalensfromatob,anLFunctorf
maps anf btoa f a. As weshallsee below, this will allow us touse a Lensabto transform a
formlens onbvaluesintooneonavalues.
TheLenscategoryhas monoidalstructure,meaningthatitsupportsthefollowingoperations:
classCategoryc)MonoidalCategorycwhere
() ::ca
1
b
1
!ca
2
b
2
!c(a
1
;a
2
)(b
1
;b
2
)
munitl ::Isoc(();a)a
munitr ::Isoc(a;())a
massoc::Isoc(a;(b;d))((a;b);d)
Here, Isocab is simplya pairofmaps cab andcba witnessing an isomorphism. Monoidal
categories arealsorequiredtosatisfyseveraladditionallaws[Mac98],whichallholdforLens.
Next,weconsidermonoidalfunctors
1
providinga unitandbinaryoperations,
classFunctorf )Monoidalf where
unit::f ()
(?) ::f a!f b!f (a;b)
andsatisfyingthe followinglaws:
fmap(gh)(u?v) = fmapgu?fmaphu
fmapfst(u?unit) = u
fmapassoc(u?(v?w)) = (u?v)?w
fmapsnd(unit?u) = u
1
Someauthors,suchasMcBrideandPaterson,calltheselaxmonoidalfunctorstodistinguishthemfromotherkinds
ofmonoidalfunctors,butthesedistinctionsareunimportantinthispapersowewilljustsaymonoidal.
6/ 21
ECEASST
NotethatthesedefinitionsassumeweareworkinginHask,aswellasoperations fst::(a;b)!a
andsnd::(a;b)!b,whicharenotavailableinallmonoidalcategories. Sinceweare interested
infunctors fromLens toHask,aminorvariant(adaptedfromMacLane[Mac98])suffices:
(M1)
lmap(fg)(u?v)=lmapf u?lmapgu
(M2)
lmapmunitl(unit?u)=u
(M3)
lmapmunitr(u?unit)=u
(M4) lmapmassoc(u?(v?w))=(u?v)?w
WearenowinapositiontodefinetheFormlenstypeandshowthatitisamonoidalfunctor:
typeFormlensa=Maybea![Int]!(Html;Env!Maybea;[Int])
The differences between this definition and the standarddefinitionforformlets are relatively
minor: wehaveaddedan extra Maybeaparameterthatprovides anoptionalinitialvalueofthe
form, changed the namesource to a list of integers, and allowed the collect function to return
an optional value. However, the type variable a appears both covariantly and contravariantly,
whichmeansthatFormlenscannotbeanordinaryHaskellfunctor,letaloneanapplicativefunc-
tor. Hence, weareforcedtoconsiderformlensesasfunctorsonLens, whosearrowsreflecttheir
bidirectionality. But then since Lens is not closed, formlenses cannot be applicative functors.
Fortunately,wewillbeabletoshowtheyaremonoidalfunctors,whichareweakerthanapplica-
tivefunctorsbutstillprovideaninterfacethatsupportscompositionofformlenses.
As afirststep, weshowthatFormlenses arelensfunctors:
instanceLFunctorFormlenswhere
lmaplnsf =Formlens(lvi!let(html;c;i
0
)=f (fmap(getl)v)i
in(html;fmap(putlv)c;i
0
)
Whenwe map a lens lns::Lensab over a formlens f::Formlensb, toobtain a Formlens a, we
renderf using the lens’s get function (to transform the a value to a b), then we post-compose
thefunction c with the lens’s putfunctionappliedto the originala. Note thatthis construction
wouldnotworkwith covariantLFunctors, because given lns::Lensabandf::Formlensa, and
abvalue,therewouldbe nowaytouselns’s put functiontoconstructanappropriate avalueto
useasargumenttof.
NextweshowthatFormlensadmitsmonoidaloperations:
instanceMonoidalFormlenswhere
unit =Formlens(l
i!(noHtml;l
!Just();i))
f?g=Formlens(lvi!let(a;b)=splitvin
let(ha;ca;i
0
)= f ai
(hb;cb;i
00
)=gbi
0
in(h1+++h2;le!liftM2(;)(cae)(cbe);i
00
)
wheresplitv=casevofJust(a;b)!(Justa;Justb)
!(Nothing;Nothing)
That is, unit generates no HTML, allocates no names, and collects (), whereas f ?g combines
twoformlenses thatseparately handle an aanda b toobtain onethathandles a pairofa and b
7/21
LensesforWebData
byconcatenatingtherenderedHTMLandusingthetwocollectfunctionstoformtheresult. The
followingtheoremstatesthatthisdefinitionsatisfies themonoidalfunctorlaws:
Theorem1 FormlensisamonoidalLFunctor.
Example. To get a taste for formlenses, let us build a bidirectional version of the dateForm
formletfromtheintroductionstartingwithformlensversionsofhtml, text,andinputInt:
htmlL::Html!Formlens()
htmlLh=Formlens(l
i!(h;l
!Just();i))
textL::String!Formlens()
textLs=htmlL(stringToHtmls)
inputIntL::FormlensInt
inputIntL=Formlens(lvi@(h:t)!
letn=intercalate"_"(mapshowi)in
(inputTagfname=n;value=(maybe""showv)g;
le!fmapread(lookupne);
(h+1):t)
Note that the collect functions forthese combinators ignore the initial value, ifany—i.e., the
formlensis essentiallybijective. Theonlysituationwherethisdoesnothappeniswhenwelmap
alensoveraformlens. Inthiscase,onlyaprojectionoftheinitialvalueisdisplayedontheform,
andthepartthatwasprojectedoutisrestoredfromtheinitialvaluewhentheformiscollected.
Next we define two helper operators, (h?) and (?i), which streamline definitions where we
combineformlenseson()values. Theseoperatorsbehavelike(?)butcombineaFormlensaand
Formlens() intoaFormlensa,ratherthanaFormlens(a;())andFormlens(();a)respectively.
(h?)::(Monoidalf;LFunctorf))f a!f ()!f a
fh?g=lmap(munitr::IsoLens(a;())a)(f?g)
The definitionofthe(?i)combinatorissymmetric,buteliminatesthe() valueusingmunitl.
Next,wedefinealensonDatevalues:
dateL :: Lens(Int;Int)Date
dateL=Lens(l(m;d)!Datemd)(l
(Datemd)!(m;d))
Finally,puttingallthesepiecestogether, wedefinea formlensforDatesasfollows:
dateFormlens::FormlensDate
dateFormlens=lmapdateL(textL"Month: "?inputIntLh?htmlLbrTagh?
textL"Day: "
?inputIntLh?htmlLbrTag)
ComparedtotheformletdateForm,wehavereplaced( )with(?),(h?),and(?i)asappropriate,
andappliedlmapdateL atthetop-level. Overall, dateFormlens maps bidirectionallybetween a
DatevalueandanHTMLformthatencodes adate,asdesired.
8/ 21
ECEASST
Figure2: ScreenshotofSpeakersformlens runninginabrowser.
Semantic Properties Classic lenses satisfy natural well-behavedness conditions such as the
G
ET
P
UT
and P
UT
G
ET
laws. A naturalquestion to ask is: are there analogous laws forform-
lenses,andaretheypreservedbyoperationssuchas(?)andlmap?
To answer this question positively, we must restrict our attention to formlenses that satisfy
certain well-formedness properties: a formlens should only draw names from the namesource
providedasanargument,andthecollectfunctionshouldonlylookupcorrespondingnames.
LetextractbeafunctionfromHtmltoEnvthatextracts anenvironmentcontainingthenames
and values of all formfields from anHTMLdocument. Also, forevery formlens f and name-
sources n;n
0
,defineanequivalencerelationonEnvvaluesas follows:
e
n;n
0
f
e
0
D
() 8v::Maybea:(
;c;
)=f vnand(
;c
0
;
)=f vn
0
impliesce=c
0
e
0
Wesaythata formlensf iswellbehavedifitsatisfiesthefollowingproperties,whichareanalo-
gousto G
ET
P
UT
and P
UT
G
ET
(thepropertyforC
REATE
G
ET
issimilar):
Definition1(Acceptability) Aformlensf::Formlensaisacceptableifforallv::a,n::Int,and
e::Env,if(h;c;
)=f (Justv)nandextracthe,thence=Justv.
Definition2(Consistency) Aformlensf::Formlensaisconsistentifforallv::a,v
0
::Maybea,
n;n
0
::Int, and e::Env, if (
;c;
)=f v
0
n
0
and ce =(Justv) and (h;
;
)=f (Justv)n, then
extracth
n;n0
f
e.
Readers familiar with lenses may note that these properties are essentially the quotient lens
laws [FPP08]. Each of the primitive formlenses described in the next section satisfies these
laws,andeachoftheformlenscombinatorspreservesthem.
3 Implementation
Wehavedevelopedanimplementationofformlensesin Haskell. This implementationprovides
acollection offormlens primitives anda translation from a higher-level syntax basedon linear
9/21
Documents you may be interested
Documents you may be interested