bartavelle / language-puppet

A library to work with Puppet manifests, test them and eventually replace everything ruby.
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

Litte question about one Prism #220

Closed PierreR closed 6 years ago

PierreR commented 6 years ago

I have a little lens question. How would you actually use the _PStringprism in here:

https://github.com/bartavelle/language-puppet/blob/master/Puppet/Interpreter/Resolve.hs#L100

I believe we can actually use _PString now that they are in the Puppet.Interpreter.Types module.

bartavelle commented 6 years ago

I think:

toStr (k,v) = fmap (k,) (preview _PString v)

If you want to obfuscate it:

toStr = traverse (preview _PString)

PierreR commented 6 years ago

Thanks for your quick reply ;-)