<commit_before>package fuel.core

/**
 * Created by <NAME> on 5/15/15.
 */

@Suppress("BASE_WITH_NULLABLE_UPPER_BOUND")
abstract public class Either<out L, out R> {

    public abstract fun component1(): L?
    public abstract fun component2(): R?

    public fun fold(fl: (L) -> Unit, fr: (R) -> Unit) {
        return when (this) {
            is Left<L, R> -> fl(this.left)
            is Right<L, R> -> fr(this.right)
            else -> throw UnsupportedOperationException()
        }
    }

    public fun swap(): Either<R, L> {
        return when (this) {
            is Left<L, R> -> Right(this.left)
            is Right<L, R> -> Left(this.right)
            else -> throw UnsupportedOperationException()
        }
    }

    public fun <X> get(): X {
        @Suppress("UNCHECKED_CAST")
        return when (this) {
            is Left<L, R> -> this.left as X
            is Right<L, R> -> this.right as X
            else -> throw UnsupportedOperationException()
        }
    }

}

public class Left<L, R>(val left: L) : Either<L, R>() {

    public override fun component1() = left
    public override fun component2() = null

}

public class Right<L, R>(val right: R) : Either<L, R>() {

    public override fun component1() = null
    public override fun component2() = right

}<commit_msg>Fix sealed Again<commit_after>package fuel.core

/**
 * Created by <NAME> on 5/15/15.
 */

@Suppress("BASE_WITH_NULLABLE_UPPER_BOUND")
sealed public class Either<out L, out R> {

    public abstract fun component1(): L?
    public abstract fun component2(): R?

    public fun fold(fl: (L) -> Unit, fr: (R) -> Unit) {
        return when (this) {
            is Left<L, R> -> fl(this.left)
            is Right<L, R> -> fr(this.right)
            else -> throw UnsupportedOperationException()
        }
    }

    public fun swap(): Either<R, L> {
        return when (this) {
            is Left<L, R> -> Right(this.left)
            is Right<L, R> -> Left(this.right)
            else -> throw UnsupportedOperationException()
        }
    }

    public fun <X> get(): X {
        @Suppress("UNCHECKED_CAST")
        return when (this) {
            is Left<L, R> -> this.left as X
            is Right<L, R> -> this.right as X
            else -> throw UnsupportedOperationException()
        }
    }

    public class Left<L, R>(val left: L) : Either<L, R>() {

        public override fun component1() = left
        public override fun component2() = null

    }

    public class Right<L, R>(val right: R) : Either<L, R>() {

        public override fun component1() = null
        public override fun component2() = right

    }
}

{'fraction_non_alphanumeric': 0.1330812854442344, 'fraction_numerical': 0.00831758034026465, 'mean_word_length': 2.073170731707317, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6874956', 'n_tokens_mistral': 828, 'n_tokens_neox': 810, 'n_words': 254}