Post History
Haskell, 51 31 bytes Saved 20 bytes thanks to Hakerh400! data S=S[S] f i=S$map f[0..i-1] Try it online! S is a recursive data structure, because sets of varying element types can't be repr...
Answer
#2: Post edited
# [Haskell], 51 bytes- <!-- language-all: lang-hs -->
- data S=S[S]
f=scanl(\(S a)b->S$a++[b])(S[])$f(f!!)[Try it online!][TIO-ko33elcq]- [Haskell]: https://www.haskell.org/
[TIO-ko33elcq]: https://tio.run/##HcmxDoIwFAXQvV9xJQxtiMTFhaTuJhqHN9YOD6HQCC2Bqp9fjePJGXl79tOUc8eJQZoMWXT96t8@DKAxfoTT24PDJO@SwKrdn6jkqjKtVZKMVaUTg5Zut1N5Zh/QNDjfIJX4S6OLAph5uUIuqw8JNQYFc6jro/3N8kqU1ktA4WIs8hc "Haskell – Try It Online"Ignore the `deriving Show` part and the `g=` in the TIO link - it's just for convenience. The function to use is `(f!!)`. `S` is a recursive data structure, because sets of varying element types can't be represented with simple lists in Haskell. `f` is an infinite list of sets.
- # [Haskell], <s>51</s> 31 bytes
- Saved 20 bytes thanks to Hakerh400!
- <!-- language-all: lang-hs -->
- data S=S[S]
- f i=S$map f[0..i-1]
- [Try it online!][TIO-kqlfuxlo]
- [Haskell]: https://www.haskell.org/
- [TIO-kqlfuxlo]: https://tio.run/##LY7BDoIwEETv/YpJwwGiEj14IcEv0FOPSMim1tCohdgaIMZvxy162s28mdltyd/M/T7PFwoEVapK1eIKW6rkQT2u1TbP7WZXzw@yDiVYPDVIzxabA/pXUOF5dEjg226AxWoFWUDGuSgpV2UZYsu@Ftb5QE4bqMgUhtY8jcDfqkAZX5DvJa4h11yUxi8WzjC2f6TQIKRjMRWTj4Ex6vTLMFhk9jQYPVPdOU2B9/kL "Haskell – Try It Online"
- `S` is a recursive data structure, because sets of varying element types can't be represented with simple lists in Haskell.
#1: Initial revision
# [Haskell], 51 bytes <!-- language-all: lang-hs --> data S=S[S] f=scanl(\(S a)b->S$a++[b])(S[])$f (f!!) [Try it online!][TIO-ko33elcq] [Haskell]: https://www.haskell.org/ [TIO-ko33elcq]: https://tio.run/##HcmxDoIwFAXQvV9xJQxtiMTFhaTuJhqHN9YOD6HQCC2Bqp9fjePJGXl79tOUc8eJQZoMWXT96t8@DKAxfoTT24PDJO@SwKrdn6jkqjKtVZKMVaUTg5Zut1N5Zh/QNDjfIJX4S6OLAph5uUIuqw8JNQYFc6jro/3N8kqU1ktA4WIs8hc "Haskell – Try It Online" Ignore the `deriving Show` part and the `g=` in the TIO link - it's just for convenience. The function to use is `(f!!)`. `S` is a recursive data structure, because sets of varying element types can't be represented with simple lists in Haskell. `f` is an infinite list of sets.