Persistend data structures in pure Haxe?

129 views
Skip to first unread message

Cambiata

unread,
Nov 30, 2016, 7:43:50 AM11/30/16
to Haxe
I'm realizing a shift of style in my coding towards a functional approach.
With that comes the issues of mutability and inefficient data duplication.

Is there something like a pure Haxe implementation of persistent data structures?

/ Jonas

JLM

unread,
Nov 30, 2016, 8:31:37 AM11/30/16
to Haxe
Jonas

I believe that is the intention of Stax's
reading the docs I believe that for collections functions such as add( .. ) return a new datastructure, and you use create to make the initital one.
https://github.com/jdegoes/stax/tree/master/src/main/haxe/haxe/data/collections
not tried it so not too sure how easy it is to mix with normal haxe or to setup and install,
interested to try but unless setup is very simple and straightforward and it does not have side effects, I am inclined to regard it from a distance with curiousity,
but I would be interested to know how you get on with it perhaps you can post back your feelings on trying it.

Cheers

Justin

Cambiata

unread,
Nov 30, 2016, 8:33:55 AM11/30/16
to Haxe
Thanks, Justin!

Will check it out and report back if I get my head around it!


JLM

unread,
Nov 30, 2016, 8:34:15 AM11/30/16
to Haxe
Perhaps it's really easy to use just the idea of it replacing rather than suplimenting the standard library seems a bit scary, not sure if you can just haxelib install it or if you copy and paste it into your haxe std folder!? But not googled it properly yet.

Franco Ponticelli

unread,
Nov 30, 2016, 2:09:37 PM11/30/16
to Haxe
In thx there are a bunch of functional oriented types as well as OOP. Just pick whatever works for you ;)

On Wed, Nov 30, 2016 at 6:34 AM JLM <j...@justinfront.net> wrote:
Perhaps it's really easy to use just the idea of it replacing rather than suplimenting the standard library seems a bit scary, not sure if you can just haxelib install it or if you copy and paste it into your haxe std folder!? But not googled it properly yet.

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Franco Ponticelli

unread,
Nov 30, 2016, 2:09:56 PM11/30/16
to Haxe
Please use the GIT version, it has much more to offer.

Stephane Le Dorze

unread,
Dec 1, 2016, 5:09:39 PM12/1/16
to Haxe
You can use Lenox minimal lense library to work in a immutable way with data-structures..

I've been successfully used it in a non trivial real-life code base, it's such a time saver!

Marcelo de Moraes Serpa

unread,
Dec 1, 2016, 8:53:40 PM12/1/16
to haxe...@googlegroups.com
Where can I find out more about Lens? Looks like an interesting concept!

--

Cambiata

unread,
Dec 2, 2016, 2:16:22 AM12/2/16
to Haxe
Thank you, Franco and Stehpane!
It seems like the linked list concept of thx/stax gives me what I need.

/ Jonas
Reply all
Reply to author
Forward
0 new messages